Appearance
vue/enforce-style-attribute
强制或禁止在 SFC 顶层样式标签中使用
scoped
和module
属性¥enforce or forbid the use of the
scoped
andmodule
attributes 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 optionplain
is used to allow style tags that have neither thescoped
normodule
attributes. Default:["scoped"]
🚀版本
¥🚀 Version
此规则是在 eslint-plugin-vue v9.20.0 中引入的
¥This rule was introduced in eslint-plugin-vue v9.20.0
🔍代码实现
¥🔍 Implementation