vue-cli+webpack搭建vue開發環境
阿新 • • 發佈:2018-12-14
安裝vue-cli
npm install -g vue-cli
下載webpack最新版本,建立檔案vue-cli
vue init webpack vue-cli
執行指令後,預設回車,如圖所示
Project name :專案名稱 (不能大寫)
Project description:專案描述
Author:作者
Vue build:本地模式
Install vue-router? 是否安裝vue的路由外掛
Use ESLint to lint your code? 是否用ESLint來限制你的程式碼錯誤和風格
Pick an ESLint preset 選擇ESPLET預置
Set up unit tests 安裝單元測試工具
Setup e2e tests with Nightwatch?是否安裝e2e來進行使用者行為模擬測試。
Should we run npm install for you after the project has been created?(recommended)npm 使用npm安裝還是yarn安裝包依賴
模板載入完成後,執行下面兩條命令
出現如下圖就是編譯成功了
開啟http://localhost:8080