pref: place the tooltip of switch bottom place at the bottom by default

This commit is contained in:
Lykin 2024-11-06 16:17:29 +08:00
parent ccb4bb85ae
commit b601ba255b
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,10 @@ const props = defineProps({
},
icons: Array,
tTooltips: Array,
tTooltipPlacement: {
type: String,
default: 'bottom',
},
iconSize: {
type: [Number, String],
default: 20,
@ -45,6 +49,7 @@ const handleSwitch = (idx) => {
v-for="(icon, i) in props.icons"
:key="i"
:disabled="!(props.tTooltips && props.tTooltips[i])"
:placement="props.tTooltipPlacement"
:show-arrow="false">
<template #trigger>
<n-button :focusable="false" :size="props.size" :tertiary="i !== props.value" @click="handleSwitch(i)">