跳至内容

vue/require-macro-variable-name

要求特定的宏变量名称

  • 💡 此规则报告的一些问题可以通过编辑器 建议 手动修复。

📖 规则详情

此规则报告不符合指定名称的宏变量。

正在加载...
正在加载...

🔧 选项

json
{
  "vue/require-macro-variable-name": ["error", {
    "defineProps": "props",
    "defineEmits": "emit",
    "defineSlots": "slots",
    "useSlots": "slots",
    "useAttrs": "attrs"
  }]
}
  • defineProps - defineProps 的宏变量名称。默认值:props
  • defineEmits - defineEmits 的宏变量名称。默认值:emit
  • defineSlots - defineSlots 的宏变量名称。默认值:slots
  • useSlots - useSlots 的宏变量名称。默认值:slots
  • useAttrs - useAttrs 的宏变量名称。默认值:attrs

使用自定义宏变量名称

正在加载...

🚀 版本

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

🔍 实现