diff --git a/packages/toolbar-vue/src/components/dropdown-list.vue b/packages/toolbar-vue/src/components/dropdown-list.vue index 8f5065c8..1c4d1c18 100644 --- a/packages/toolbar-vue/src/components/dropdown-list.vue +++ b/packages/toolbar-vue/src/components/dropdown-list.vue @@ -2,12 +2,12 @@
- { - const { command } = item + const { command, key } = item let { hotkey } = item //默认获取插件的热键 if (props.engine && (hotkey === true || hotkey === undefined)) { + console.log(item) hotkey = autoGetHotkey( props.engine, command && !Array.isArray(command) ? command.name : props.name, + key ); } if (typeof hotkey === 'string' && hotkey !== '') { @@ -52,10 +54,10 @@ export default defineComponent({ return hotkey } - const hotkeys = props.items.map(item => { - return {[item.key]:getHotkey(item)} + const hotkeys:{[key: string]: any} = {} + props.items.forEach(item => { + hotkeys[item.key] = getHotkey(item) }) - return { isMobile, hotkeys