Skip to content

Commit

Permalink
Use only single props
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi committed Sep 6, 2024
1 parent 59fe09a commit 4967296
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions packages/design-system/src/components/N8nTooltip/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ export type Justify =
| 'space-around'
| 'space-evenly';
// eslint-disable-next-line vue/valid-define-props, vue/require-macro-variable-name
const elTooltipProps = defineProps({
const props = defineProps({
...ElTooltip.props,
});
// eslint-disable-next-line vue/valid-define-props
defineProps({
content: {
type: String,
default: '',
Expand All @@ -43,22 +38,19 @@ defineOptions({
</script>

<template>
<ElTooltip
v-bind="{ ...elTooltipProps, ...$attrs }"
:popper-class="elTooltipProps.popperClass ?? 'n8n-tooltip'"
>
<ElTooltip v-bind="{ ...props, ...$attrs }" :popper-class="props.popperClass ?? 'n8n-tooltip'">
<slot />
<template #content>
<slot name="content">
<div v-html="content"></div>
<div v-html="props.content"></div>
</slot>
<div
v-if="buttons.length"
v-if="props.buttons.length"
:class="$style.buttons"
:style="{ justifyContent: justifyButtons }"
:style="{ justifyContent: props.justifyButtons }"
>
<N8nButton
v-for="button in buttons"
v-for="button in props.buttons"
:key="button.attrs.label"
v-bind="{ ...button.attrs, ...button.listeners }"
/>
Expand Down

0 comments on commit 4967296

Please sign in to comment.