关于nuxt报错Require self-closing on HTML elements (
) vue/html-self-closing的解决方法

首先找到 .eslintrc.js文件

然后在rules中添加以下配置

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

 

ok,完美决绝问题

完整配置如下

  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"
    }]
  }

 

你可能感兴趣的:(关于nuxt报错Require self-closing on HTML elements (
) vue/html-self-closing的解决方法)