1.安裝node.js

1.png
2.安裝vue-cli
國內(nèi)淘寶的鏡像:
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
安裝腳手架:
$ cnpm install vue-cli -g
查看版本號:
$ vue -V

2.png
3.新建項目
$ vue init webpack [projectname]
- Project name (demo01): -----項目名稱,回車按照括號中默認名字(注意名字不能有大寫字母,如果有會報錯。ps.阮一峰老師博客為什么文件名要小寫 。
- Project description (A Vue.js project): ----項目描述,可直接回車
- Author (): ----輸入作者
- Runtime + Compiler: recommended for most users 運行加編譯,推薦
Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specificHTML) are ONLY allowed in .vue files - render functions are required elsewhere 僅運行時 - Install vue-router? (Y/n) 是否安裝vue-router,官方的路由,輸入“y”后回車
- Use ESLint to lint your code? (Y/n) 是否使用ESLint管理代碼
- Pick an ESLint preset (Use arrow keys) 選擇一個ESLint預(yù)設(shè),編寫vue項目時的代碼風(fēng)格
- Setup unit tests with Karma + Mocha? (Y/n) 是否安裝單元測試
- Setup e2e tests with Nightwatch(Y/n)? 是否安裝e2e測試

3.png
$ npm run dev
打開瀏覽器輸入http://localhost:8080/

vuepage.png