Skip to content

vue/require-macro-variable-name

要求某个宏变量名称

  • 💡 此规则报告的某些问题可由编辑器 suggestions 手动修复。

📖 规则详情

此规则报告与指定名称不对应的宏变量。

¥This rule reports macro variables not corresponding to the specified name.

Now loading...
Now loading...

🔧选项

¥🔧 Options

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

    ¥defineProps - The name of the macro variable for defineProps. default: props

  • defineEmits - defineEmits 的宏变量名称。默认:emit

    ¥defineEmits - The name of the macro variable for defineEmits. default: emit

  • defineSlots - defineSlots 的宏变量名称。默认:slots

    ¥defineSlots - The name of the macro variable for defineSlots. default: slots

  • useSlots - useSlots 的宏变量名称。默认:slots

    ¥useSlots - The name of the macro variable for useSlots. default: slots

  • useAttrs - useAttrs 的宏变量名称。默认:attrs

    ¥useAttrs - The name of the macro variable for useAttrs. default: attrs

使用自定义宏变量名

¥With custom macro variable names

Now loading...

🚀版本

¥🚀 Version

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

¥This rule was introduced in eslint-plugin-vue v9.15.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号