fix: modify related problem tooltip bug(#18853)

This commit is contained in:
wangdan-fit2cloud 2024-12-23 17:40:09 +08:00
parent 4920e8787b
commit 91dac247c9
3 changed files with 7 additions and 12 deletions

View File

@ -1,15 +1,11 @@
<template>
<el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs">
<auto-tooltip :content="tooltipContent">
<slot></slot>
</auto-tooltip>
<slot></slot>
</el-tag>
</template>
<script setup lang="ts">
import { ref, computed, useSlots } from 'vue'
defineOptions({ name: 'TagEllipsis' })
const slots = useSlots()
const tooltipContent = slots.default?.()?.[0].children || ''
</script>
<style lang="scss" scoped>
/* tag超出省略号 */
@ -27,10 +23,5 @@ const tooltipContent = slots.default?.()?.[0].children || ''
white-space: nowrap;
text-overflow: ellipsis;
}
// :deep(.el-tooltip__trigger) {
// overflow: hidden;
// white-space: nowrap;
// text-overflow: ellipsis;
// }
}
</style>

View File

@ -41,7 +41,9 @@
effect="plain"
closable
>
{{ item.content }}
<auto-tooltip :content="item.content">
{{ item.content }}
</auto-tooltip>
</TagEllipsis>
</template>
</div>

View File

@ -45,7 +45,9 @@
effect="plain"
closable
>
{{ item.content }}
<auto-tooltip :content="item.content">
{{ item.content }}
</auto-tooltip>
</TagEllipsis>
</template>
</div>