跳至内容

vue/enforce-style-attribute

强制或禁止在 SFC 顶级样式标签中使用 scopedmodule 属性

📖 规则详情

此规则允许您明确允许在顶级样式标签上使用 scopedmodule 属性。

"scoped"

正在加载...

"module"

正在加载...

"plain"

正在加载...

🔧 选项

json
{
  "vue/enforce-style-attribute": [
    "error",
    { "allow": ["scoped", "module", "plain"] }
  ]
}
  • "allow" (["scoped" | "module" | "plain"]) 允许在顶级样式标签上使用的属性数组。选项 plain 用于允许既没有 scoped 也 没有 module 属性的样式标签。默认值:["scoped"]

🚀 版本

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

🔍 实现