Appearance
vue/prop-name-casing
强制 Vue 组件中 Prop 名称使用特定大小写
- ⚙️ 此规则包含在
"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"]
中。
📖 规则详情
此规则强制在 vue 组件中正确使用 props 的大小写(camelCase)。
¥This rule enforce proper casing of props in vue components(camelCase).
🔧选项
¥🔧 Options
json
{
"vue/prop-name-casing": ["error",
"camelCase" | "snake_case",
{
"ignoreProps": []
}
]
}
"camelCase"
(默认)...强制props
中的属性名称为驼峰式大小写。¥
"camelCase"
(default) ... Enforce property names inprops
to camel case."snake_case"
...强制props
中的属性名称为蛇形大小写。¥
"snake_case"
... Enforce property names inprops
to snake case.ignoreProps
(string[]
) ...不需要遵循指定大小写的 prop 名称(或模式)数组。¥
ignoreProps
(string[]
) ... An array of prop names (or patterns) that don't need to follow the specified casing.
"snake_case"
"ignoreProps": ["foo-bar", "/^_[a-z]+/u"]
👫相关规则
¥👫 Related Rules
📚扩展阅读
¥📚 Further Reading
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v4.3.0 中引入
¥This rule was introduced in eslint-plugin-vue v4.3.0
🔍代码实现
¥🔍 Implementation