Appearance
vue/no-setup-props-destructure
禁止将失去
props
反应性的用法传递给setup
- ⛔ 此规则已在 eslint-plugin-vue v10.0.0 中删除,并由 vue/no-setup-props-reactivity-loss 规则替换。
📖 规则详情
此规则报告传递给 setup
的 props
的解构导致值失去反应性。
¥This rule reports the destructuring of props
passed to setup
causing the value to lose reactivity.
解构传递给 setup
的 props
将导致值失去反应性。
¥Destructuring the props
passed to setup
will cause the value to lose reactivity.
此外,在 setup()
的根范围内解构应该会出错,但在嵌套回调或返回的渲染函数中可以:
¥Also, destructuring in root scope of setup()
should error, but ok inside nested callbacks or returned render functions:
🔧选项
¥🔧 Options
无。
¥Nothing.
📚扩展阅读
¥📚 Further Reading
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.0.0 中引入
¥This rule was introduced in eslint-plugin-vue v7.0.0
🔍代码实现
¥🔍 Implementation