vue創建並初始化項目


一、npm安裝

https://nodejs.org/en/中下載nodejs並安裝
1.cmd檢測是否安裝成功
node –v 和 npm –v
2.使用淘寶的npm 鏡像
$  npm  install  -g  cnpm  --registry=https://registry.npm.taobao.org
 
        

二、第二步項目初始化

1.安裝vue-cli
cnpm install vue-cli -g      //全局安裝 vue-cli

 

三、新建vue項目

在運行(Ctrl+R)中輸入cmd進入dos:

vue init webpack  "項目名稱"
? Project name //項目名稱 ? Project description A Vue.js project //項目描述,默認的 ? Author *@qq.com //默認,回車即可 ? Vue build (Use arrow keys) //默認,回車即可 ? Vue build standalone //默認,回車即可 ? Install vue-router? No //是否安裝路由 ? Use ESLint to lint your code? Yes //是否用ESLint來規范我們的代碼 ? Set up unit tests No //是否使用自動化的測試工具 ? Setup e2e tests with Nightwatch? No //使用nightatch設置E2E測試 ? Should we run npm install for you after the project has been created? (recommended) npm //選擇npm安裝
 
四、安裝相關依賴

cnpm install

五、運行項目

npm run dev

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM