日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > vue >内容正文

vue

vue新建一个项目

發(fā)布時(shí)間:2023/12/20 vue 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vue新建一个项目 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

確保nodejs.cn已經(jīng)安裝好

判斷是否安裝好

node -v(檢查版本號)
npm -v (檢查是否安裝npm)

npm淘寶鏡像

npm install -g cnpm --registry=https://registry.npm.taobao.org(如果沒有安裝淘寶鏡像,后面的命令把cnpm換成npm)

創(chuàng)建vue項(xiàng)目

1、cnpm install -g @vue/cli

2、vue create my-project

按鍵盤上下鍵選擇默認(rèn)(default)還是手動(dòng)(Manually),如果選擇default,一路回車執(zhí)行下去就行了(注:現(xiàn)在vue-cli3.0默認(rèn)使用yarn下載),這里我選擇手動(dòng)

Vue CLI v4.5.4 ? Please pick a preset:Default ([Vue 2] babel, eslint)Default (Vue 3 Preview) ([Vue 3] babel, eslint) > Manually select features

根據(jù)需求選擇, 按鍵盤上下鍵移動(dòng),按space鍵確認(rèn)選擇

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project:(*) Choose Vue version(*) Babel( ) TypeScript( ) Progressive Web App (PWA) Support(*) Router(*) Vuex >(*) CSS Pre-processors(*) Linter / Formatter( ) Unit Testing( ) E2E Testing

選擇您想要開始項(xiàng)目的Vue.js版本

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with2.x > 3.x (Preview)

因?yàn)榘惭b了router所以會彈出來,選擇Y

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) y

選擇css預(yù)處理,這里我選擇stylus

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default):Sass/SCSS (with dart-sass)Sass/SCSS (with node-sass)Less > Stylus

選擇 ESLint with error prevention only作為代碼檢查

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus ? Pick a linter / formatter config:> ESLint with error prevention onlyESLint + Airbnb configESLint + Standard config ESLint + Prettier

Lint on save(保存就檢測),Lint and fix on commit (fix和commit檢查),我選擇 Lint on save

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus ? Pick a linter / formatter config: Prettier ? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection) >(*) Lint on save( ) Lint and fix on commit

把babel .eslint這些文件放在獨(dú)立的文件里還是package.json里,我選擇放在獨(dú)立文件夾

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus ? Pick a linter / formatter config: Prettier ? Pick additional lint features: Lint on save ? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys) > In dedicated config filesIn package.json

是否記錄下,以便下次繼續(xù)使用這套配置,選擇N 不記錄

Vue CLI v4.5.4 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus ? Pick a linter / formatter config: Prettier ? Pick additional lint features: Lint on save ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files ? Save this as a preset for future projects? n

我選擇npm安裝(根據(jù)自己需求來)

Vue CLI v4.5.6 ? 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 selection) ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection) ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection) ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection) ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection) ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors, Linter ? Choose a version of Vue.js that you want to start the project with 3.x (Preview) ? Use history mode for router? (Requires proper server setup for index fallback in production) Yes ? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Stylus ? Pick a linter / formatter config: Prettier ? Pick additional lint features: Lint on save ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files ? Save this as a preset for future projects? No ? Pick the package manager to use when installing dependencies:Use Yarn > Use NPM

表示安裝成功

Vue CLI v4.5.4 ? Creating project in C:\Users\Administrator\my-project. � Initializing git repository... ?? Installing CLI plugins. This might take a while...> yorkie@2.0.0 install C:\Users\Administrator\my-project\node_modules\yorkie > node bin/install.jssetting up Git hooks done> core-js@3.6.5 postinstall C:\Users\Administrator\my-project\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}"> ejs@2.7.4 postinstall C:\Users\Administrator\my-project\node_modules\ejs > node ./postinstall.jsadded 1241 packages from 919 contributors in 33.591s50 packages are looking for fundingrun `npm fund` for details� Invoking generators... � Installing additional dependencies...added 92 packages from 91 contributors in 9.984s55 packages are looking for fundingrun `npm fund` for details? Running completion hooks...� Generating README.md...� Successfully created project my-project. � Get started with the following commands:$ cd my-project

安裝后移動(dòng)到目錄 并啟動(dòng)

cd my-project
npm run serve

啟動(dòng)成功

DONE Compiled successfully in 4493ms 5:04:29 ├F10: PM ┤App running at:- Local: http://localhost:8081/- Network: http://192.168.5.251:8081/Note that the development build is not optimized.To create a production build, run npm run build.

總結(jié)

以上是生活随笔為你收集整理的vue新建一个项目的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。