Skip to content

vue/no-setup-props-destructure

禁止将失去 props 反应性的用法传递给 setup

📖 规则详情

此规则报告传递给 setupprops 的解构导致值失去反应性。

¥This rule reports the destructuring of props passed to setup causing the value to lose reactivity.

Now loading...

解构传递给 setupprops 将导致值失去反应性。

¥Destructuring the props passed to setup will cause the value to lose reactivity.

Now loading...

此外,在 setup() 的根范围内解构应该会出错,但在嵌套回调或返回的渲染函数中可以:

¥Also, destructuring in root scope of setup() should error, but ok inside nested callbacks or returned render functions:

Now loading...

🔧选项

¥🔧 Options

无。

¥Nothing.

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v7.0.0 中引入

¥This rule was introduced in eslint-plugin-vue v7.0.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号