This commit is contained in:
Your Name
2026-03-01 14:17:59 +08:00
parent 65aa12f146
commit a07e844c47
6071 changed files with 777651 additions and 0 deletions
@@ -0,0 +1,47 @@
<template>
<div>
<el-tooltip v-bind="props" :disabled="disabled">
<div
ref="textRef"
class="overflow-text truncate"
:style="{ textOverflow: overfloType }"
>
{{ content }}
</div>
</el-tooltip>
</div>
</template>
<script lang="ts" setup>
import { useEventListener } from '@vueuse/core'
import { type Placement, useTooltipContentProps } from 'element-plus'
import type { PropType } from 'vue'
const props = defineProps({
...useTooltipContentProps,
teleported: {
type: Boolean,
default: false
},
placement: {
type: String as PropType<Placement>,
default: 'top'
},
overfloType: {
type: String as PropType<'ellipsis' | 'unset' | 'clip'>,
default: 'ellipsis'
}
})
const textRef = shallowRef<HTMLElement>()
const disabled = ref(false)
useEventListener(textRef, 'mouseenter', () => {
if (textRef.value?.scrollWidth! > textRef.value?.offsetWidth!) {
disabled.value = false
} else {
disabled.value = true
}
})
</script>
<style></style>