关于nuxt报错Require self-closing on HTML elements (<div>) 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"
    }]
  }

 

posted @ 2019-01-18 11:21  花生奶糖  阅读(15699)  评论(1编辑  收藏  举报