1.進入項目所在文件夾
cd:D:\vuePro
2.安裝node npm(node-v npm-v 查看是否安裝及版本號)
3.安裝vue npm install -g vue-cli --registry=https://registry.npm.taobao.org (npm vue -v 查看是否安裝及版本號)
4.創建項目框架 vue init webpack vue-test vue-test爲項目名稱
Project name (vue-test) # 項目名稱(我的項目)
Project name vue-test # 項目名稱我的項目
Project description (A Vue.js project) # 項目描述一個Vue.js 項目
Project description A Vue.js project # 項目說明一個 Vue.js 項目
Author (huyihan <[email protected]>) # 作者 (huyihan <[email protected]>)
Use ESLint to lint your code? (Y/n) # 使用 ESLint 到你的代碼? (Y [ yes ] / N [ no ])//eslint
算是一個代碼語法規範檢查的工具
Use ESLint to lint your code? Yes # 使用 ESLint 到你的代碼? 是
Pick an ESLint preset (Use arrow keys) # 選擇一個預置ESLint(使用箭頭鍵)
Pick an ESLint preset Standard # 選擇一個預置ESLint標準
Setup unit tests with Karma + Mocha? (Y/n) # 設置單元測Karma + Mocha? (Y/ N)
Setup unit tests with Karma + Mocha? Yes # 設置單元測Karma + Mocha?是
Setup e2e tests with Nightwatch? (Y/n) # 設置端到端測試,Nightwatch? (Y/ N)
Setup e2e tests with Nightwatch? Yes # 設置端到端測試,Nightwatch? 是
5.進入項目 cd:vue-test
6.安裝項目依賴 npm install --registry=https://registry.npm.taobao.org
7.運行 npm run dev (http://localhost:8080)
8.引入element-ui npm i element-ui -S
修改main.js
import ElementUI from 'element-ui'
Vue.use(elementUI)