(1)To turn it off, set vetur.validation.template: false
.html
这时错误并不会消息。vue
(2)在git bash中输入yarn add -D eslint eslint-plugin-vue,若没有安装yarn则须要先安装,安装可采用npm的安装方法;git
(3)在eslintrc.js中配置,以下:github
1 extends: [ 2 // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention 3 // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 4 'plugin:vue/recommended', //1 5 // https://github.com/standard/standard/blob/master/docs/RULES-en.md 6 'recommended' //2 7 ], 8 // required to lint *.vue files 9 plugins: [ 10 'vue' 11 ], 12 // add your custom rules here 13 rules: { 14 // allow async-await 15 'generator-star-spacing': 'off', 16 // allow debugger during development 17 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 18 "vue/html-self-closing": "off" //3 19 } 20 }
这样就能够解决问题了!npm
参考:https://github.com/vuejs/vetur/blob/master/docs/linting-error.md#linting-for-templatebash