搭建vue-cli並初始化項目


#安裝淘寶鏡像
npm install -g cnpm --registry=https://registry.npm.taobao.org
#安裝vue-cli
cnpm install vue-cli -g
#查看是否安裝成功
vue -V
初始化項目 --projectdemo 項目名
vue init webpack projectdemo

 

? Project name demo                          //項目名稱
? Project description this is demo        //項目描述
? Author ananiha                               // 作者
    // 然后回車
? Install vue-router? Y                        //y   安裝路由
? Use ESLint to lint your code? N        // n
? Set up unit tests No                       // n
? Setup e2e tests with Nightwatch? N             // n 
? Should we run `npm install` for you after the project has been cr
? Should we run `npm install` for you after the project has been cr
? Should we run `npm install` for you after the project has been cr

mended) (Use arrow keys)
   Yes, use NPM
> Yes, use Yarn
   No, I will handle that myself
                           //回車 
To get started:

  cd demo
  npm run dev

Documentation can be found at https://vuejs-templates.github.io/webpack
   //根據以上提示輸入
cd demo                 //進入目錄
cnmp install            //提示會少這一命令 如果根據提示啟動失敗加這一句
npm run dev           //啟動 會自己跳轉瀏覽

 


免責聲明!

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



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