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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

idea2020.2.2怎么创建web项目_创建Vue3.0的项目

發布時間:2023/12/4 vue 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 idea2020.2.2怎么创建web项目_创建Vue3.0的项目 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1. 查看Vue的環境版本

Vue -V

如果版本低于4.0,則需要升級Vue的版本

npm install -g @vue/cli

2. 創建Vue 3.0的項目

3. VS Code 的環境配置

安裝Extension:ESLintVetur

VS Code基于ESLint的Auto Save功能,可以很好的格式化代碼,讓代碼更加干凈整潔,且利于團隊協作。

3.1 VS Code setting.json的配置

{ "window.zoomLevel": 0, "terminal.integrated.rendererType": "dom", "editor.formatOnSave": true, "eslint.lintTask.enable": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "vetur.format.defaultFormatterOptions": { "prettier": { "semi": false, "singleQuote": true }, "js-beautify-html": { "wrap_attributes": "auto", "wrap_line_length": 12000, "end_with_newline": false } }, "explorer.confirmDelete": false, "vetur.format.defaultFormatter.html": "js-beautify-html", "vetur.format.defaultFormatter.js": "vscode-typescript", "javascript.format.insertSpaceAfterSemicolonInForStatements": false, "prettier.semi": false, "typescript.format.insertSpaceAfterSemicolonInForStatements": false, "vetur.grammar.customBlocks": { "docs": "md", "i18n": "json" }}

3.2 項目文件.eslintrc.js的配置

module.exports = { root: true, env: { node: true }, extends: [ 'plugin:vue/vue3-essential', '@vue/standard', '@vue/typescript/recommended' ], parserOptions: { ecmaVersion: 2020 }, rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', "comma-dangle": [1, { "objects": "always", "arrays": "ignore", "imports": "ignore", "exports": "ignore", "functions": "ignore" }] }}

3.3 項目文件package.json需要安裝eslint相關的Dependencies.

{ "name": "gitinfo-dashboard", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint" }, "dependencies": { "core-js": "^3.6.5", "vue": "^3.0.0", "vue-class-component": "^8.0.0-0", "vue-router": "^4.0.0-0", "vuex": "^4.0.0-0" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.33.0", "@typescript-eslint/parser": "^2.33.0", "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-typescript": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0", "@vue/eslint-config-standard": "^5.1.2", "@vue/eslint-config-typescript": "^5.0.2", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.0", "eslint-plugin-vue": "^7.0.0-0", "typescript": "~3.9.3" }}

4. 最后,讓項目跑起來

npm installnpm run serve

參考文檔:

1. https://cli.vuejs.org/

2. https://v3.vuejs.org/

總結

以上是生活随笔為你收集整理的idea2020.2.2怎么创建web项目_创建Vue3.0的项目的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。