fix(projects): fix pin-toggler toolTip zIndex

This commit is contained in:
Soybean 2024-03-27 22:32:35 +08:00
parent 6b5132c169
commit f89e6c0361
2 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ const icon = computed(() => (props.pin ? 'mdi-pin-off' : 'mdi-pin'));
<ButtonIcon <ButtonIcon
:tooltip-content="pin ? $t('icon.pin') : $t('icon.unpin')" :tooltip-content="pin ? $t('icon.pin') : $t('icon.unpin')"
tooltip-placement="bottom-start" tooltip-placement="bottom-start"
trigger-parent :z-index="100"
> >
<SvgIcon :icon="icon" /> <SvgIcon :icon="icon" />
</ButtonIcon> </ButtonIcon>

View File

@ -17,13 +17,15 @@ interface Props {
tooltipContent?: string; tooltipContent?: string;
/** Tooltip placement */ /** Tooltip placement */
tooltipPlacement?: PopoverPlacement; tooltipPlacement?: PopoverPlacement;
zIndex?: number;
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
class: 'h-36px text-icon', class: 'h-36px text-icon',
icon: '', icon: '',
tooltipContent: '', tooltipContent: '',
tooltipPlacement: 'bottom' tooltipPlacement: 'bottom',
zIndex: 98
}); });
interface ButtonProps { interface ButtonProps {
@ -58,7 +60,7 @@ const cls = computed(() => {
</DefineButton> </DefineButton>
<!-- define component end: Button --> <!-- define component end: Button -->
<NTooltip v-if="tooltipContent" :placement="tooltipPlacement" :z-index="98"> <NTooltip v-if="tooltipContent" :placement="tooltipPlacement" :z-index="zIndex">
<template #trigger> <template #trigger>
<Button :class-name="cls" v-bind="$attrs"> <Button :class-name="cls" v-bind="$attrs">
<slot> <slot>