{"id":14997,"date":"2023-11-30T11:45:51","date_gmt":"2023-11-30T03:45:51","guid":{"rendered":"https:\/\/www.zhidianwl.com\/zhidian\/?p=14997"},"modified":"2023-11-30T11:45:51","modified_gmt":"2023-11-30T03:45:51","slug":"layuu%e5%bc%80%e5%8f%91%e5%ae%89%e5%8d%93app%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.com\/zhidian\/2023\/14997\/","title":{"rendered":"layuu\u5f00\u53d1\u5b89\u5353app\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"

Layuu \u662f\u4e00\u6b3e\u57fa\u4e8e Vue.js \u5f00\u53d1\u7684\u79fb\u52a8\u7aef UI \u6846\u67b6\uff0c\u5b83\u652f\u6301\u5168\u7aef\u9002\u914d\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u79fb\u52a8\u8bbe\u5907\u548c\u5c4f\u5e55\u5c3a\u5bf8\u3002\u4f7f\u7528 Layuu \u53ef\u4ee5\u5feb\u901f\u6784\u5efa\u51fa\u4e00\u6b3e\u6f02\u4eae\u3001\u6d41\u7545\u7684\u5b89\u5353 A\u5b89\u5353APP\u5f00\u53d1<\/a>PP \u5e94\u7528\uff0c\u4e0b\u9762\u6211\u4eec\u6765\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u5982\u4f55\u5229\u7528 Layuu \u5f00\u53d1\u5b89\u5353 APP\u3002<\/p>\n

1\u3001\u73af\u5883\u642d\u5efa<\/p>\n

\u9996\u5148\u9700\u8981\u5b89\u88c5 Node.js \uff0c\u901a\u8fc7 npm \u5b89\u88c5 Vue CLI\uff0c\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8e Vue.js \u7684\u9879\u76ee\uff0c\u5e76\u4e14\u5728\u9879\u76ee\u4e2d\u5b89\u88c5 Layuu\u3002<\/p>\n

\u5b89\u88c5 Node.js \uff1a https:\/\/nodejs.org<\/p>\n

\u5b89\u88c5Vue CLI\uff1a<\/p>\n

“`<\/p>\n

npm install -g @vue\/cli<\/p>\n

“`<\/p>\n

\u521b\u5efa\u9879\u76ee\uff1a<\/p>\n

“`<\/p>\n

vue create app<\/p>\n

“`<\/p>\n

\u5b89\u88c5Layuu\uff1a<\/p>\n

“`<\/p>\n

npm install layuu<\/p>\n

“`<\/p>\n

\u53ea\u9700\u8981\u5728 main.js \u4e2d\u5f15\u5165 layuu \u7ec4\u4ef6\u5e93\uff0c\u7136\u540e\u5728 Vue \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a<\/p>\n

“`<\/p>\n

import Vue from ‘vue’<\/p>\n

import Layuu from ‘layuu’<\/p>\n

import ‘layuu\/dist\/layuu.css’<\/p>\n

Vue.use(Layuu)<\/p>\n

“`<\/p>\n

2\u3001\u7ec4\u4ef6\u4f7f\u7528<\/p>\n

Layuu \u5c01\u88c5\u4e86\u8bb8\u591a UI \u7ec4\u4ef6\uff0c\u5177\u6709\u7f8e\u89c2\uff0c\u6613\u7528\u7b49\u4f18\u52bf\uff0c\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u5feb\u901f\u6784\u5efa\u51fa\u4f18\u79c0\u7684\u5e94\u7528\u754c\u9762\u3002<\/p>\n

\u4f8b\u5982\u7528\u6765\u5236\u4f5c\u6309\u94ae\u7684\u7ec4\u4ef6\uff1a<\/p>\n

“`<\/p>\n

\n

\u8fd9\u662f\u4e00\u4e2aPrimary\u6309\u94ae<\/p>\n<\/p>\n

import { Button } from ‘layuu’<\/p>\n

export default {<\/p>\n

co\u5b89\u5353app\u5f00\u53d1\u5de5\u5177<\/a>mponents: {<\/p>\n

LayButton: Button<\/p>\n

}<\/p>\n

}<\/p>\n<\/p>\n

“`<\/p>\n

\u4e0a\u8ff0\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2a Primary \u7c7b\u578b\u7684\u6309\u94ae\uff0c\u7ec4\u4ef6\u540d\u79f0\u4e3a LayButto<\/p>\n

<\/figure>\n<\/p>\n

n\u3002\u8fd9\u65f6\u5019\u5c31\u53ef\u4ee5\u5728\u5e94\u7528\u4e2d\u4f7f\u7528\u8fd9\u4e2a\u6309\u94ae\u7ec4\u4ef6\u4e86\u3002<\/p>\n

3\u3001\u6784\u5efaAPP<\/p>\n

\u5728\u5b8c\u6210\u754c\u9762\u7684\u6784\u5efa\u540e\uff0c\u9700\u8981\u901a\u8fc7\u6253\u5305\u5de5\u5177\u8fdb\u884c\u6253\u5305\uff0c\u751f\u6210 APK \u6587\u4ef6\u3002<\/p>\n

\u901a\u8fc7 Cordova \u548c PhoneGap \u8fd9\u6837\u7684\u6846\u67b6\uff0c\u53ef\u4ee5\u5c06 Vue.js \u7684\u9879\u76ee\u6253\u5305\u6210\u53ef\u6267\u884c\u7684\u5b89\u5353 APP\uff0c\u8fd9\u91cc\u5c31\u4e0d\u5177\u4f53\u5c55\u5f00\u4e86\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528 Layuu \u642d\u5efa\u548c\u5f00\u53d1\u5b89\u5353 APP \u7684\u57fa\u672c\u6d41\u7a0b\u548c\u6b65\u9aa4\uff0c\u76f8\u4fe1\u80fd\u591f\u5e2e\u52a9\u5230\u4f60\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Layuu \u662f\u4e00\u6b3e\u57fa\u4e8e Vue.js \u5f00\u53d1\u7684\u79fb\u52a8\u7aef UI \u6846\u67b6\uff0c\u5b83\u652f\u6301\u5168\u7aef\u9002\u914d\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u79fb\u52a8\u8bbe\u5907\u548c\u5c4f\u5e55\u5c3a\u5bf8\u3002\u4f7f\u7528 Layuu \u53ef\u4ee5\u5feb\u901f\u6784\u5efa\u51fa\u4e00\u6b3e\u6f02\u4eae\u3001\u6d41\u7545\u7684\u5b89\u5353 APP \u5e94\u7528\uff0c\u4e0b\u9762\u6211\u4eec\u6765\u8be6\u7ec6\u4ecb\u7ecd\u4e00<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[22250,22251,3379,914,322],"class_list":{"0":"post-14997","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-zuoapp","7":"tag-app","9":"tag-3379","10":"tag-914","11":"tag-322"},"_links":{"self":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/14997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/comments?post=14997"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/14997\/revisions"}],"predecessor-version":[{"id":15000,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/14997\/revisions\/15000"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/media?parent=14997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/categories?post=14997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/tags?post=14997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}