Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into dev
This commit is contained in:
commit
de27e8691d
@ -1,9 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CSSProperties } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
|
|
||||||
import { VbenTooltip } from '@vben-core/shadcn-ui';
|
|
||||||
import { computed, ref, watchEffect } from 'vue';
|
import { computed, ref, watchEffect } from 'vue';
|
||||||
|
|
||||||
|
import { VbenTooltip } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
|
import { useElementSize } from '@vueuse/core';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
* 是否启用点击文本展开全部
|
* 是否启用点击文本展开全部
|
||||||
@ -77,11 +80,13 @@ const ellipsis = ref();
|
|||||||
const isExpand = ref(false);
|
const isExpand = ref(false);
|
||||||
const defaultTooltipMaxWidth = ref();
|
const defaultTooltipMaxWidth = ref();
|
||||||
|
|
||||||
|
const { width: eleWidth } = useElementSize(ellipsis);
|
||||||
|
|
||||||
watchEffect(
|
watchEffect(
|
||||||
() => {
|
() => {
|
||||||
if (props.tooltip && ellipsis.value) {
|
if (props.tooltip && eleWidth.value) {
|
||||||
defaultTooltipMaxWidth.value =
|
defaultTooltipMaxWidth.value =
|
||||||
props.tooltipMaxWidth ?? ellipsis.value.offsetWidth + 24;
|
props.tooltipMaxWidth ?? eleWidth.value + 24;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ flush: 'post' },
|
{ flush: 'post' },
|
||||||
|
Loading…
Reference in New Issue
Block a user