關於nuxt報錯Require self-closing on HTML elements ( ) vue/html-self-closing的解決方法

首先找到 .eslintrc.js文件html

而後在rules中添加如下配置vue

"vue/html-self-closing": ["error",{
      "html": {
        "void": "never",
        "normal": "any",
        "component": "any"
      },
      "svg": "always",
      "math": "always"
    }]

 

ok,完美決絕問題svg

完整配置以下spa

  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'generator-star-spacing': 'off',
    "vue/html-self-closing": ["error",{
      "html": {
        "void": "never",
        "normal": "any",
        "component": "any"
      },
      "svg": "always",
      "math": "always"
    }]
  }
相關文章
相關標籤/搜索