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:propsdefineEmits-defineEmits的宏变量名称。默认:emit¥
defineEmits- The name of the macro variable fordefineEmits. default:emitdefineSlots-defineSlots的宏变量名称。默认:slots¥
defineSlots- The name of the macro variable fordefineSlots. default:slotsuseSlots-useSlots的宏变量名称。默认:slots¥
useSlots- The name of the macro variable foruseSlots. default:slotsuseAttrs-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