vue2.0 创建项目
生活随笔
收集整理的這篇文章主要介紹了
vue2.0 创建项目
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
準備
npm install -g cnpm --registry=https://registry.npm.taobao.org
添加系統變量path的內容
因為cnpm會被安裝到D:\Program Files\nodejs\node_global下,而系統變量path并未包含該路徑。在系統變量path下添加該路徑即可正常使用cnpm。
cnpm -v
npm install -g @vue/cli
查看版本(是否安裝成功):vue -V
創建一個項目
vue create project-name
還原項目 在根目錄 cnpm install
選擇第二個
Vue CLI v3.5.1 ┌───────────────────────────┐ │ Update available: 3.9.3 │ └───────────────────────────┘ ? Please pick a preset: Manually select features ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert sele? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert sele? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert sele? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert sele? Check the features needed for your project:(*) Babel >(*) TypeScript( ) Progressive Web App (PWA) Support(*) Router(*) Vuex(*) CSS Pre-processors(*) Linter / Formatter( ) Unit Testing( ) E2E Testing這里既然選擇了typescript為什么還要用babel,這里是希望使用babel的編譯功能,ts生成es6代碼,再經過babel編譯成es5代碼;
選擇需要插件 使用空格選擇,回車進行下一步
VSCode 內置格式化插件導致代碼格式化會自動換行問題,解決辦法
1、設置
2、搜索 vetur
3、右邊三個點按鈕,-> open settings.json
添加以下代碼:
轉載于:https://www.cnblogs.com/sands/p/11284621.html
總結
以上是生活随笔為你收集整理的vue2.0 创建项目的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue-cli3.0 Typescrip
- 下一篇: What are current fas