ionic-不推荐使用`slot`属性-eslint-plugin-vue

我在 VS Code 中遇到以下错误:

[vue/no-deprecated-slot-attribute]
`slot` attributes are deprecated. eslint-plugin-vue

我安装了这两个插件 .eslintrc.js

  'extends': [
    'plugin:vue/vue3-essential',
    'eslint:recommended'
  ],

这在规则中:

'vue/no-deprecated-slot-attribute': 'off',

应该怎么做才能避免这个问题?

回答

这个插槽实际上是指webcomponent插槽;
https://github.com/ionic-team/ionic-framework/issues/22236

Ionic 框架使用的插槽与 Vue 2 插槽不同。我们使用的插槽是 Web 组件插槽并且是有效用法:https : //developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots。

开发人员应该根据我们的文档使用 Web 组件插槽来定位元素:https : //ionicframework.com/docs/api/range#usage

检查以确保您的 eslint.js 具有以下规则:

  rules: {
    'vue/no-deprecated-slot-attribute': 'off',
  }
  rules: {
    'vue/no-deprecated-slot-attribute': 'off',
  }

接下来打开 .vscode/settings.json 并添加以下内容:

  • what is the purpose of this thing: `"vetur.validation.template": false,`?
    Is it going to disable the vue validator ?

以上是ionic-不推荐使用`slot`属性-eslint-plugin-vue的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>