vue 开发环境搭建
1.創(chuàng)建vue項(xiàng)目
1.node js 生成項(xiàng)目,編譯項(xiàng)目
2.hbuilder 開(kāi)發(fā)環(huán)境
1.下載安裝node js
http://nodejs.cn/download/
?
確認(rèn)是否安裝成功
?
如果安裝不了 代碼錯(cuò)誤2503
解決方法:
管理員命令運(yùn)行cmd;
cd\
cd C:\Users\Administrator\Desktop
msiexec/package node-v6.3.1-x64.msi
(msi是版本號(hào))
2.安裝 VUE CLI?
vue cli 是一個(gè)腳手架工具,用于生成一個(gè)基礎(chǔ)的vue應(yīng)用。
npm install vue-cli -g
3.新建一個(gè)Vue項(xiàng)目
cd 目錄(你要把項(xiàng)目放在哪個(gè)目錄)
- vue init webpack pname(你的項(xiàng)目名字);
- ? Project description (A Vue.js project) vue-cli新建項(xiàng)目(項(xiàng)目描述);
- ? Author (xhdx <zhuming3834@sina.com>) ;zhuming3834@sina.com(項(xiàng)目作者);
-
? Vue build
? Runtime + Compiler: recommended for most users
Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files - render functions are required elsewhere
這里選擇Runtime + Compiler: recommended for most users; -
? Install vue-router? (Y/n) y 是否使用vue-router,這里根據(jù)需求選擇;
-
? Use ESLint to lint your code? (Y/n) y 是否使用ESLint,這里根據(jù)需求選擇;
-
? Pick an ESLint preset (Use arrow keys)
? Standard (https://github.com/feross/standard)
Airbnb (https://github.com/airbnb/javascript) none (configure it yourself) 這里選擇Standard (https://github.com/feross/standard) -
? Setup unit tests with Karma + Mocha? (Y/n) n 是否需要單元測(cè)試,這里根據(jù)需求選擇;
-
Setup e2e tests with Nightwatch? (Y/n) n是否需要單元測(cè)試,這里根據(jù)需求選擇;
-
cd pname(項(xiàng)目目錄);
-
npm install 安裝依賴(lài)
-
npm run dev 本地運(yùn)行項(xiàng)目
?
?
?
?
?
?
?
?
?
?
?
?
?
默認(rèn)瀏覽器會(huì)自動(dòng)打開(kāi)http://localhost:8080/#/,出現(xiàn)如下頁(yè)面:?
一共13步,一個(gè)vue-cli新建的模板項(xiàng)目就運(yùn)行起來(lái)了。
轉(zhuǎn)載于:https://www.cnblogs.com/yubaibai/p/10457290.html
總結(jié)
以上是生活随笔為你收集整理的vue 开发环境搭建的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: oracle 11gogg,【OGG】O
- 下一篇: 宗成庆《统计自然语言处理》 目录的思维导