2021-01-17 18:57:57 +01:00
|
|
|
<template>
|
2021-11-13 21:28:29 +01:00
|
|
|
<component :is="is" class="shortcuts">
|
2021-08-19 21:10:29 +02:00
|
|
|
<template v-for="(k, i) in keys" :key="i">
|
|
|
|
<kbd>{{ k }}</kbd>
|
2021-11-13 21:28:29 +01:00
|
|
|
<span v-if="i < keys.length - 1">{{ combination }}</span>
|
2021-01-17 18:57:57 +01:00
|
|
|
</template>
|
2021-11-13 21:28:29 +01:00
|
|
|
</component>
|
2021-01-17 18:57:57 +01:00
|
|
|
</template>
|
|
|
|
|
2021-12-04 15:47:32 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
defineProps({
|
|
|
|
keys: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
2021-01-17 18:57:57 +01:00
|
|
|
},
|
2021-12-04 15:47:32 +01:00
|
|
|
combination: {
|
|
|
|
type: String,
|
|
|
|
default: '+',
|
|
|
|
},
|
|
|
|
is: {
|
|
|
|
type: String,
|
|
|
|
default: 'div',
|
|
|
|
},
|
|
|
|
})
|
2021-01-17 18:57:57 +01:00
|
|
|
</script>
|
2021-09-24 20:08:48 +02:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.shortcuts {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
kbd {
|
|
|
|
padding: .1rem .35rem;
|
2021-11-22 22:12:54 +01:00
|
|
|
border: 1px solid var(--grey-300);
|
|
|
|
background: var(--grey-100);
|
2021-09-24 20:08:48 +02:00
|
|
|
border-radius: 3px;
|
|
|
|
font-size: .75rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
span {
|
|
|
|
padding: 0 .25rem;
|
|
|
|
}
|
|
|
|
</style>
|