vue項目搭建
vue項目快速搭建工具——vue-cli
vue-cli是基于node環(huán)境的一個命令行工具。也就是說要執(zhí)行命令
安裝
npm install vue-cli -g
安裝-
使用
- 創(chuàng)建項目文件夾 如:d:/mypro
- 進入文件夾,執(zhí)行命令:
vue init webpack [項目名稱]
初始化一個vue+webpack項目
? Project name learn
? Project description A Vue.js project
? Author leiyang <leiyang_39@163.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Setup unit tests with Karma + Mocha? Yes
? Setup e2e tests with Nightwatch? Yes
- 運行
-
cd learn
在文件夾中,執(zhí)行npm install
更新項目的依賴模塊【node_modules】項目搭建完成! - 命令行進入文件夾,執(zhí)行令 >
npm run dev
以開發(fā)模式啟動項目服務器
就可以打開瀏覽器通過http://localhost:8080
訪問項目
-