mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 09:04:07 -08:00
8d12c1ad8d
![image](https://github.com/n8n-io/n8n/assets/8850410/5a601fae-cb8e-41bb-beca-ac9ab7065b75)
37 lines
808 B
Vue
37 lines
808 B
Vue
<script setup lang="ts">
|
|
import type { Placement } from 'element-plus';
|
|
import type { KeyboardShortcut } from 'n8n-design-system/src/components/N8nKeyboardShortcut';
|
|
|
|
interface Props {
|
|
label: string;
|
|
shortcut: KeyboardShortcut;
|
|
placement?: Placement;
|
|
}
|
|
withDefaults(defineProps<Props>(), { placement: 'top' });
|
|
</script>
|
|
|
|
<template>
|
|
<n8n-tooltip :placement="placement" :show-after="500">
|
|
<template #content>
|
|
<div :class="$style.shortcut">
|
|
<div :class="$style.label">{{ label }}</div>
|
|
<n8n-keyboard-shortcut v-bind="shortcut"></n8n-keyboard-shortcut>
|
|
</div>
|
|
</template>
|
|
<slot />
|
|
</n8n-tooltip>
|
|
</template>
|
|
|
|
<style lang="scss" module>
|
|
.shortcut {
|
|
display: flex;
|
|
align-items: center;
|
|
font-size: var(--font-size-2xs);
|
|
gap: var(--spacing-2xs);
|
|
}
|
|
|
|
.label {
|
|
flex-shrink: 0;
|
|
}
|
|
</style>
|