解决iview中</Input>标签报错的方法

(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

猜你喜欢

转载自www.cnblogs.com/lanyb009/p/9246712.html