feat: improve shortcut types
This commit is contained in:
parent
1665cd57cb
commit
6c113eaca1
@ -4,13 +4,13 @@ import {isAppleDevice} from '@/helpers/isAppleDevice'
|
|||||||
|
|
||||||
const ctrl = isAppleDevice() ? '⌘' : 'ctrl'
|
const ctrl = isAppleDevice() ? '⌘' : 'ctrl'
|
||||||
|
|
||||||
interface Shortcut {
|
export interface Shortcut {
|
||||||
title: string
|
title: string
|
||||||
keys: string[]
|
keys: string[]
|
||||||
combination?: 'then'
|
combination?: 'then'
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ShortcutGroup {
|
export interface ShortcutGroup {
|
||||||
title: string
|
title: string
|
||||||
available?: (route: RouteLocation) => boolean
|
available?: (route: RouteLocation) => boolean
|
||||||
shortcuts: Shortcut[]
|
shortcuts: Shortcut[]
|
||||||
@ -158,4 +158,4 @@ export const KEYBOARD_SHORTCUTS : ShortcutGroup[] = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
] as const
|
||||||
|
@ -14,19 +14,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
defineProps({
|
withDefaults(defineProps<{
|
||||||
keys: {
|
keys: string[],
|
||||||
type: Array,
|
combination?: string,
|
||||||
required: true,
|
is?: string
|
||||||
},
|
}>(), {
|
||||||
combination: {
|
combination: '+',
|
||||||
type: String,
|
is: 'div',
|
||||||
default: '+',
|
|
||||||
},
|
|
||||||
is: {
|
|
||||||
type: String,
|
|
||||||
default: 'div',
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user