Skip to content

vue/max-props

强制 Vue 组件中的最大 props 数量

¥enforce maximum number of props in Vue component

📖 规则详情

此规则强制在 Vue SFC 中强制最大数量的 props,以帮助提高可维护性并降低复杂性。

¥This rule enforces a maximum number of props in a Vue SFC, in order to aid in maintainability and reduce complexity.

🔧选项

¥🔧 Options

此规则采用一个对象,你可以在其中指定 Vue SFC 中允许的最大 props 数量。可以为对象指定一个属性。

¥This rule takes an object, where you can specify the maximum number of props allowed in a Vue SFC. There is one property that can be specified for the object.

  • maxProps ...指定 script 块中的最大 props 数量。

    ¥maxProps ... Specify the maximum number of props in the script block.

{ maxProps: 1 }

Now loading...

{ maxProps: 5 }

Now loading...

🚀版本

¥🚀 Version

此规则是在 eslint-plugin-vue v9.28.0 中引入的

¥This rule was introduced in eslint-plugin-vue v9.28.0

🔍代码实现

¥🔍 Implementation

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