你不知道的SpringBoot與Vue部署解決方案
阿新 • • 發佈:2020-11-09
1.使用到環境 node.js
連結:https://pan.baidu.com/s/1MSj1dXR5upQShYaY4cdqiw
提取碼:ushe
2.全域性安裝 vue-cli npm install --global vue-cli 【ps:將npm替換成cnpm 淘寶映象 npm install -g cnpm --registry=https://registry.npm.taobao.org 】
3.前兩步完成之後 檢查環境有沒有配置完成;首先 開啟cmd 命令列 執行 npm -v 如果出現版本號則代表ok 再執行 vue -V 注意這次是 大寫的V 如果出現版本號則代表ok
4.如果環境沒問題了 cmd 命令列執行 vue init webpack my-project
## 接著會提示一些選項,根據自己的需求填寫或選擇y/n ## 專案名稱 ? Project name (my-project) ? Project name my-project ## 專案描述 ? Project description (A Vue.js project) ? Project description A Vue.js project ## 專案作者 ? Author (techlee <xxx@xxx.com>) ? Author [email protected] ? Vue build standalone ## 是否安裝vue-router路由,這裡選是 ? Install vue-router? (Y/n) y ? Install vue-router? Yes ## 是否需要ESLint程式碼檢查,這裡選否 ? Use ESLint to lint your code? (Y/n) n ? Use ESLint to lint your code? No ## 是否需要unit單元測試,這裡選否 ? Setup unit tests with Karma + Mocha? (Y/n) n ? Setup unit tests with Karma + Mocha? No ## 是否需要e2e,這裡選否 ? Setup e2e tests with Nightwatch? (Y/n) n ? Setup e2e tests with Nightwatch? No 安裝相關依賴 ## 切換到專案目錄 cd my-project ## 使用npm安裝依賴 npm install ## 執行專案 npm run dev ## 打包專案 npm run build
5.執行 npm run dev 然後開啟瀏覽器輸入相應地址就搭建完成了。