使用VS Code配置Vue開發環境


1.Vetur(VScode 上 Vue 工具)官方推薦,作用:高亮.VUE文件,附帶有格式化功能,配合Eslint插件對代碼進行格式化檢查。

2.Eslint+Prettier(規范代碼工具)檢查你的js、html、css代碼,確保它們符合規范。

 

 

3.打開設置界面:VS Code 文件 > 首選項 > 設置,點擊右上角,進行設置

 

 

 

{
  // prettier:每行在這個字符數內整合代碼,如果你的屏幕較寬分辨率較高可以適當加大
  "prettier.printWidth": 120,
  // prettier:是否在每行末尾加上分號
  "prettier.semi": false,
  // prettier:如果為true,將使用單行否則使用雙引號
  "prettier.singleQuote": true,
  // vetur:對html的內容使用js-beautify-html
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "files.autoSave":"off",
  "emmet.syntaxProfiles": {
    "vue-html": "html",
    "vue": "html"
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "html",
    { "language": "vue", "autoFix": true }
  ],
  "eslint.options": {
    "plugins": ["html"]
  }
}

 

 

 


免責聲明!

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



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