解決iview中標簽報錯的方法


(1)To turn it off, set vetur.validation.template: false.

這時錯誤並不會消息。

(2)在git bash中輸入yarn add -D eslint eslint-plugin-vue,若沒有安裝yarn則需要先安裝,安裝可采用npm的安裝方法;

(3)在eslintrc.js中配置,如下:

 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 }

這樣就可以解決問題了!

參考:https://github.com/vuejs/vetur/blob/master/docs/linting-error.md#linting-for-template


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM