{"id":997,"date":"2023-03-12T08:16:07","date_gmt":"2023-03-12T00:16:07","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=997"},"modified":"2023-04-29T13:20:00","modified_gmt":"2023-04-29T05:20:00","slug":"use-vue-cli-to-quickly-build-vue-projects","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/12\/use-vue-cli-to-quickly-build-vue-projects\/","title":{"rendered":"\u4f7f\u7528vue-cli\u5feb\u901f\u642d\u5efavue\u9879\u76ee"},"content":{"rendered":"<h2>\u7b80\u4ecb<\/h2>\n<ul>\n<li>Vue.js\uff08\u8bfb\u97f3 \/vju\u02d0\/, \u7c7b\u4f3c\u4e8e view\uff09 \u662f\u4e00\u5957\u6784\u5efa\u7528\u6237\u754c\u9762\u7684\u6e10\u8fdb\u5f0f\u6846\u67b6<\/li>\n<li>Vue \u53ea\u5173\u6ce8\u89c6\u56fe\u5c42\uff0c \u91c7\u7528\u81ea\u5e95\u5411\u4e0a\u589e\u91cf\u5f00\u53d1\u7684\u8bbe\u8ba1<\/li>\n<li>Vue \u7684\u76ee\u6807\u662f\u901a\u8fc7\u5c3d\u53ef\u80fd\u7b80\u5355\u7684 API \u5b9e\u73b0\u54cd\u5e94\u7684\u6570\u636e\u7ed1\u5b9a\u548c\u7ec4\u5408\u7684\u89c6\u56fe\u7ec4\u4ef6<\/li>\n<\/ul>\n<p><!-- more --><\/p>\n<h2>\u4f7f\u7528vue-cli\u5feb\u901f\u642d\u5efavue\u9879\u76ee<\/h2>\n<p>Vue.js \u63d0\u4f9b\u4e00\u4e2a\u5b98\u65b9\u547d\u4ee4\u884c\u5de5\u5177 vue-cli\uff0c\u53ef\u7528\u4e8e\u5feb\u901f\u642d\u5efa\u5927\u578b\u5355\u9875\u5e94\u7528\u3002<\/p>\n<h3>npm<\/h3>\n<pre><code>$ npm install npm@latest -g  #\u5347\u7ea7npm\n$ npm -v\n$ npm install --global vue-cli  #\u5168\u5c40\u5b89\u88c5vue-cli\n$ vue init webpack my-project  #\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8ewebpack\u6a21\u677f\u7684\u65b0\u9879\u76ee\n$ cd my-project\n$ npm install\n$ npm run dev<\/code><\/pre>\n<h3>cnpm<\/h3>\n<pre><code>$ npm install npm@latest -g  #\u5347\u7ea7npm\n$ npm -v\n$ npm install cnpm -g\n$ cnpm install --global vue-cli  \/\/\u5168\u5c40\u5b89\u88c5vue-cli\n$ vue init webpack my-project  \/\/\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8ewebpack\u6a21\u677f\u7684\u65b0\u9879\u76ee\u3002\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\uff0c\u9ed8\u8ba4\u56de\u8f66\u5373\u53ef\n$ cd my-project\n$ cnpm install\n$ cnpm install vue-router  \/\/\u5b89\u88c5Vue.js\u8def\u7531\u5e93\n$ cnpm run dev<\/code><\/pre>\n<p>\u6210\u529f\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u540e\u8bbf\u95ee\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/localhost:8080\/\">http:\/\/localhost:8080\/<\/a>#\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb Vue.js\uff08\u8bfb\u97f3 \/vju\u02d0\/, \u7c7b\u4f3c\u4e8e view\uff09 \u662f\u4e00\u5957\u6784\u5efa\u7528\u6237\u754c\u9762\u7684\u6e10\u8fdb\u5f0f\u6846\u67b6 Vue \u53ea\u5173\u6ce8\u89c6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-997","post","type-post","status-publish","format-standard","hentry","category-vue"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}