为了在vscode中方便快捷的开发Vue项目,向大家推荐以下插件。它们的功能是:1.AutoCloseTag自动关闭html标签2.AutoRenameTag在修改HTML标签时自动修改匹配的标签3.DebuggerforChrome调试工具4.ESLint高亮5.在浏览器中打开转换成html文件是在浏览器中打开6.Prettier-Codeformatter代码格式化工具7.Vetur目前比较好的Vue语法高亮8.vscode-icons文件图标,方便文件定位9.vueVSCodeSnippets生成vue模板代码10.vue-helper代码提示下面插件再介绍几个小方法。1、保存文件时,自动格式化编辑setting.json文件,如下defaultFormatter":"vscode.typescript-language-features"//保存js文件时格式相同},//vscode默认启用根据文件类型自动设置tabsize的选项"editor.detectIndentation":false,//ResetSettabsize"editor.tabSize":2,//#每次保存时自动格式化"editor.formatOnSave":true,//添加vue支持"eslint.validate":["javascript","javascriptreact",{"language":"vue","autoFix":true}],//#让prettier使用eslint代码格式进行校验//"prettier.eslintIntegration":true,////#去掉代码末尾的分号//"prettier.semi":true,////#使用引号代替双引号//"prettier.singleQuote":true,//#在函数(名称)和后面的括号之间添加一个空格"javascript.format.insertSpaceBeforeFunctionParenthesis":true,//#这个根据用户自己的习惯选择"vetur.format.defaultFormatter.html":"js-beautify-html",//#让vue中的js跟着自带的ts走编辑器格式化"vetur.format.defaultFormatter.js":"vscode-typescript","vetur.format.defaultFormatterOptions":{"js-beautify-html":{//"wrap_attributes":"force-aligned","wrap_attributes":"auto",//#vue组件中的html代码格式化样式"prettier":{//不带分号的格式"semi":false,//带单引号的格式"singleQuote":true}}},"editor.codeActionsOnSave":{"source.fixAll.eslint":true},2.有时可能会发生linux系统下保存文件后没有编译,这时候只要在/etc/sysctl.conf中添加一行:fs.inotify.max\_user\_watches=524288
