(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