diff --git a/packages/varlet-ui/src/menu-option/MenuOption.vue b/packages/varlet-ui/src/menu-option/MenuOption.vue index 64153c8ce77..cd7abd3f27e 100644 --- a/packages/varlet-ui/src/menu-option/MenuOption.vue +++ b/packages/varlet-ui/src/menu-option/MenuOption.vue @@ -148,11 +148,11 @@ export default defineComponent({ } if (event.key === 'ArrowRight') { - call(props.onKeyboardTrigger, event.key) + call(props.onKeyArrowX, event.key) } if (event.key === 'ArrowLeft') { - call(props.onKeyboardTrigger, event.key) + call(props.onKeyArrowX, event.key) } } diff --git a/packages/varlet-ui/src/menu-option/props.ts b/packages/varlet-ui/src/menu-option/props.ts index 58531b09334..cb48b0b57be 100644 --- a/packages/varlet-ui/src/menu-option/props.ts +++ b/packages/varlet-ui/src/menu-option/props.ts @@ -14,5 +14,5 @@ export const props = { option: Object as PropType, childrenTrigger: Boolean, highlight: Boolean, - onKeyboardTrigger: defineListenerProp<(trigger: 'ArrowLeft' | 'ArrowRight') => void>(), + onKeyArrowX: defineListenerProp<(trigger: 'ArrowLeft' | 'ArrowRight') => void>(), } diff --git a/packages/varlet-ui/src/menu-select/MenuChildren.vue b/packages/varlet-ui/src/menu-select/MenuChildren.vue index 12930f5812f..812e755ec84 100644 --- a/packages/varlet-ui/src/menu-select/MenuChildren.vue +++ b/packages/varlet-ui/src/menu-select/MenuChildren.vue @@ -20,7 +20,7 @@ :ripple="option.ripple" :disabled="option.disabled" :highlight="highlightOptions.includes(option)" - @keyboard-trigger="handleArrowRight" + @key-arrow-x="handleArrowRight" @mouseenter="handleTriggerMouseenter" /> @@ -33,8 +33,9 @@ :parent-show="show" :option="option" :options="option[childrenKey]" + :highlight-options="highlightOptions" :disabled="option.disabled || !show" - @keyboard-trigger="handleArrowLeft" + @key-arrow-x="handleArrowLeft" @trigger-mouseenter="allowChildrenClose(option)" />