具体报错信息:

[vue/valid-v-on]
Avoid using JavaScript keyword as "v-on" value: "handleSearchTable".eslint-plugin-vue

[vue/no-parsing-error]
Parsing error: control-character-in-input-stream.eslint-plugin-vue

[vue/no-parsing-error]
Parsing error: Unexpected character ''.eslint-plugin-vue
editor.defaultFormatter
Syntax Error: SyntaxError:

解决方法

  1. command+shift+p > setting.json,主要设置vetur
{
  "editor.fontSize": 12,
  "files.autoSave": "afterDelay", //失去焦点自动保存
  "workbench.startupEditor": "welcomePage",
  "editor.quickSuggestions": {
    "strings": true
  },
  // vue设置
  "emmet.syntaxProfiles": {
    "vue-html": "html",
    "vue": "html"
  },
  "files.associations": {
    "*.vue": "vue"
  },
  // vetur设置
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "vetur.format.defaultFormatter.js": "vscode-typescript",
  "vetur.validation.template": true,
  // format设置
  "javascript.format.insertSpaceBeforeFunctionParenthesis": false,
  "editor.formatOnSave": true,
  // "[html]": {
  //   "editor.defaultFormatter": "HookyQR.beautify"
  // },
  "workbench.colorTheme": "Visual Studio Dark",
  "editor.detectIndentation": false,
  /** Easy Sass 插件 **/
  "easysass.formats": [
    {
      "format": "compressed", // 压缩
      "extension": ".css"
    }
  ],
  "easysass.targetDir": "./css/" // 自定义css输出文件路径
}
  1. eslint > setting.json,主要设置eslint
{
  "window.zoomLevel": 1,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.tabSize": 2,
  "files.associations": {
    "*.vue": "vue"
  },
  // "eslint.autoFixOnSave": true,
  // "eslint.validate": [
  //   "javascript",
  //   "javascriptreact",
  //   "vue"
  //   {
  //     "language": "html",
  //     "autoFix": true
  //   },
  //   {
  //     "language": "vue",
  //     "autoFix": true
  //   }
  // ],
  "eslint.options": {
    "extensions": [
      ".js",
      ".vue"
    ]
  },
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/dist": true
  },
  "emmet.syntaxProfiles": {
    "javascript": "jsx",
    "vue": "html",
    "vue-html": "html"
  },
  "git.confirmSync": false,
  // "window.zoomLevel": 0,
  "editor.renderWhitespace": "boundary",
  "editor.cursorBlinking": "smooth",
  "editor.minimap.enabled": true,
  "editor.minimap.renderCharacters": false,
  "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
  "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
  "editor.codeLens": true,
  "editor.snippetSuggestions": "top",
  "workbench.colorTheme": "Dracula Soft",
  "auto-close-tag.excludedTags": [
    "area",
    "base",
    "br",
    "col",
    "command",
    "embed",
    "hr",
    "img",
    "input",
    "keygen",
    "link",
    "meta",
    "param",
    "source",
    "track",
    "wbr"
  ],
  "gitlens.advanced.blame.customArguments": [],
  "eslint.codeAction.disableRuleComment": {
    
  },
}
Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐