Skip to content

vue/require-valid-default-prop

强制 props 默认值有效

  • ⚙️ 此规则包含在 "plugin:vue/essential"*.configs["flat/essential"]"plugin:vue/vue2-essential"*.configs["flat/vue2-essential"]"plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/vue2-strongly-recommended"*.configs["flat/vue2-strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"]"plugin:vue/vue2-recommended"*.configs["flat/vue2-recommended"] 中。

📖 规则详情

此规则检查每个 prop 的默认值对给定类型是否有效。当使用函数未返回类型 ArrayObject 的默认值时,应报告错误。

¥This rule checks whether the default value of each prop is valid for the given type. It should report an error when default value for type Array or Object is not returned using function.

Now loading...

🔧选项

¥🔧 Options

无。

¥Nothing.

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v3.13.0 中引入

¥This rule was introduced in eslint-plugin-vue v3.13.0

🔍代码实现

¥🔍 Implementation

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