vue报错: [eslint-plugin-vue] [vue/valid-v-for] [vue/no-parsing-error]

叁歲伎倆 2023-02-24 03:59 110阅读 0赞

具体报错信息:

  1. [vue/valid-v-on]
  2. Avoid using JavaScript keyword as "v-on" value: "handleSearchTable".eslint-plugin-vue
  3. [vue/no-parsing-error]
  4. Parsing error: control-character-in-input-stream.eslint-plugin-vue
  5. [vue/no-parsing-error]
  6. Parsing error: Unexpected character ''.eslint-plugin-vue
  7. editor.defaultFormatter
  8. Syntax Error: SyntaxError:

解决方法

  1. command+shift+p > setting.json,主要设置vetur

    {
    “editor.fontSize”: 12,
    “files.autoSave”: “afterDelay”, //失去焦点自动保存
    “workbench.startupEditor”: “welcomePage”,
    “editor.quickSuggestions”: {

    1. "strings": true

    },
    // vue设置
    “emmet.syntaxProfiles”: {

    1. "vue-html": "html",
    2. "vue": "html"

    },
    “files.associations”: {

    1. "*.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”: [

    1. {
    2. "format": "compressed", // 压缩
    3. "extension": ".css"
    4. }

    ],
    “easysass.targetDir”: “./css/“ // 自定义css输出文件路径
    }

  2. eslint > setting.json,主要设置eslint

    {
    “window.zoomLevel”: 1,
    “editor.codeActionsOnSave”: {

    1. "source.fixAll.eslint": true

    },
    “editor.tabSize”: 2,
    “files.associations”: {

    1. "*.vue": "vue"

    },
    // “eslint.autoFixOnSave”: true,
    // “eslint.validate”: [
    // “javascript”,
    // “javascriptreact”,
    // “vue”
    // {
    // “language”: “html”,
    // “autoFix”: true
    // },
    // {
    // “language”: “vue”,
    // “autoFix”: true
    // }
    // ],
    “eslint.options”: {

    1. "extensions": [
    2. ".js",
    3. ".vue"
    4. ]

    },
    “search.exclude”: {

    1. "**/node_modules": true,
    2. "**/bower_components": true,
    3. "**/dist": true

    },
    “emmet.syntaxProfiles”: {

    1. "javascript": "jsx",
    2. "vue": "html",
    3. "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”: [

    1. "area",
    2. "base",
    3. "br",
    4. "col",
    5. "command",
    6. "embed",
    7. "hr",
    8. "img",
    9. "input",
    10. "keygen",
    11. "link",
    12. "meta",
    13. "param",
    14. "source",
    15. "track",
    16. "wbr"

    ],
    “gitlens.advanced.blame.customArguments”: [],
    “eslint.codeAction.disableRuleComment”: {

    },
    }

发表评论

表情:
评论列表 (有 0 条评论,110人围观)

还没有评论,来说两句吧...

相关阅读

    相关 vue常见记录

    最近用vue,因为不熟练,所以总是踩了很多坑。这里记录一些我自己遇到过的报错问题,希望对大家有所帮助。 1:方法命名冲突,导致函数无法正常执行,页面报错如下图 ![Cent