gpt4 book ai didi

javascript - ionic - `slot` 属性已弃用 - eslint-plugin-vue

转载 作者:行者123 更新时间:2023-12-05 00:25:33 28 4
gpt4 key购买 nike

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

[vue/no-deprecated-slot-attribute]
`slot` attributes are deprecated. eslint-plugin-vue
enter image description here
我在 .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

The slots Ionic Framework uses are not the same as Vue 2 slots. The slots we use are Web Component slots and are valid usage: https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots.


Developers should be using the Web Component slots to position elements as per our docs: https://ionicframework.com/docs/api/range#usage


检查以确保您的 eslint.js 具有以下规则:
  rules: {
'vue/no-deprecated-slot-attribute': 'off',
}
接下来打开 .vscode/settings.json 并添加以下内容:
  "vetur.validation.template": false,

关于javascript - ionic - `slot` 属性已弃用 - eslint-plugin-vue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65913547/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com