Appearance
vue/require-macro-variable-name
要求某个宏变量名称
- 💡 此规则报告的某些问题可由编辑器 suggestions 手动修复。
📖 规则详情
此规则报告与指定名称不对应的宏变量。
¥This rule reports macro variables not corresponding to the specified name.
🔧选项
¥🔧 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 fordefineProps
. default:props
defineEmits
-defineEmits
的宏变量名称。默认:emit
¥
defineEmits
- The name of the macro variable fordefineEmits
. default:emit
defineSlots
-defineSlots
的宏变量名称。默认:slots
¥
defineSlots
- The name of the macro variable fordefineSlots
. default:slots
useSlots
-useSlots
的宏变量名称。默认:slots
¥
useSlots
- The name of the macro variable foruseSlots
. default:slots
useAttrs
-useAttrs
的宏变量名称。默认:attrs
¥
useAttrs
- The name of the macro variable foruseAttrs
. default:attrs
使用自定义宏变量名
¥With custom macro variable names
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v9.15.0 中引入
¥This rule was introduced in eslint-plugin-vue v9.15.0
🔍代码实现
¥🔍 Implementation