vue2.0 创建项目
生活随笔
收集整理的這篇文章主要介紹了
vue2.0 创建项目
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
準(zhǔn)備
npm install -g cnpm --registry=https://registry.npm.taobao.org
添加系統(tǒng)變量path的內(nèi)容
因?yàn)閏npm會被安裝到D:\Program Files\nodejs\node_global下,而系統(tǒng)變量path并未包含該路徑。在系統(tǒng)變量path下添加該路徑即可正常使用cnpm。
cnpm -v
npm install -g @vue/cli
查看版本(是否安裝成功):vue -V
創(chuàng)建一個(gè)項(xiàng)目
vue create project-name
還原項(xiàng)目 在根目錄 cnpm install
選擇第二個(gè)
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代碼,再經(jīng)過babel編譯成es5代碼;
選擇需要插件 使用空格選擇,回車進(jìn)行下一步
VSCode 內(nèi)置格式化插件導(dǎo)致代碼格式化會自動換行問題,解決辦法
1、設(shè)置
2、搜索 vetur
3、右邊三個(gè)點(diǎn)按鈕,-> open settings.json
添加以下代碼:
轉(zhuǎn)載于:https://www.cnblogs.com/sands/p/11284621.html
總結(jié)
以上是生活随笔為你收集整理的vue2.0 创建项目的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue-cli3.0 Typescrip
- 下一篇: html5倒计时秒杀怎么做,vue 设