vue建立並初始化項目

1、npm安裝

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

2、第二步項目初始化

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

 

3、新建vue項目

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

vue init webpack  "項目名稱"
? Project name //項目名稱 ? Project description A Vue.js project //項目描述,默認的 ? Author c *@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安裝
 
4、安裝相關依賴

cnpm install

5、運行項目

npm run dev
相關文章
相關標籤/搜索