Appearance
vue/enforce-style-attribute
强制或禁止在 SFC 顶层样式标签中使用
scoped和module属性¥enforce or forbid the use of the
scopedandmoduleattributes in SFC top level style tags
📖 规则详情
此规则允许你明确允许在顶层样式标签上使用 scoped 和 module 属性。
¥This rule allows you to explicitly allow the use of the scoped and module attributes on your top level style tags.
"scoped"
"module"
"plain"
🔧选项
¥🔧 Options
json
{
"vue/enforce-style-attribute": [
"error",
{ "allow": ["scoped", "module", "plain"] }
]
}"allow"(["scoped" | "module" | "plain"])允许在顶层样式标签上使用的属性数组。选项plain用于允许既没有scoped也没有module属性的样式标记。默认值:["scoped"]¥
"allow"(["scoped" | "module" | "plain"]) Array of attributes to allow on a top level style tag. The optionplainis used to allow style tags that have neither thescopednormoduleattributes. Default:["scoped"]
🚀版本
¥🚀 Version
此规则是在 eslint-plugin-vue v9.20.0 中引入的
¥This rule was introduced in eslint-plugin-vue v9.20.0
🔍代码实现
¥🔍 Implementation