news 2026/4/18 10:17:03

表头标题表头

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
表头标题表头
// customTooltip 组件 <template> <div @mouseenter="handleMouseenter" style="width: 100%"> <el-tooltip placement="top" :disabled="disabled" :content="props.content" @mouseleave="mouseleave" popper-class="tooltip"> <slot></slot> </el-tooltip> </div> </template> <script setup lang="ts"> import { ref } from 'vue' const props = defineProps({ content: { type: String, default: '', }, }) const disabled = ref(true) const handleMouseenter = (e: any) => { if (!props.content) { return } const cellChild = e.target.children[0] // range 表示文档的一个区域 const range = document.createRange() range.setStart(cellChild, 0) range.setEnd(cellChild, cellChild.childNodes.length) const flag = getStyle(cellChild, '-webkit-line-clamp') console.log(flag) if (flag == 'none') { // rangeWidth 表示元素内容的宽度 const rangeWidth = range.getBoundingClientRect().width let padding = (parseInt(getStyle(cellChild, 'paddingLeft')) || 0) + (parseInt(getStyle(cellChild, 'paddingRight')) || 0) // cellChild.offsetWidth 表示选定区域的宽度 if (rangeWidth > cellChild.offsetWidth - padding) { // 显示tooltip disabled.value = false } else { disabled.value = true } } else { // rangeHeight 表示元素内容的高度 const rangeHeight = range.getBoundingClientRect().height let padding = (parseInt(getStyle(cellChild, 'paddingTop')) || 0) + (parseInt(getStyle(cellChild, 'paddingBottom')) || 0) // cellChild.offsetHeight 表示选定区域的高度 if (rangeHeight > cellChild.offsetHeight - padding) { // 显示tooltip disabled.value = false } else { disabled.value = true } } } const mouseleave = () => { disabled.value = true } // 获取dom的样式 const getStyle = (dom: any, attr: any) => { return getComputedStyle(dom, null)[attr] } </script> <style lang="scss"> .tooltip { position: relative; z-index: 9999999 !important; } </style>
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/18 4:37:45

2025年AI工具定价指南:主流平台技术特性与成本效益分析

2025 AI工具定价指南&#xff1a;哪个平台适合您&#xff1f; 人工智能工具已成为我们日常生活不可或缺的一部分。然而&#xff0c;市场上数十种不同的选择&#xff0c;使得挑选最适合您需求且在预算内提供最佳价值的工具&#xff0c;变成了一个相当复杂的过程。根据我20多年的…

作者头像 李华
网站建设 2026/4/18 8:29:20

Clawdbot背后的技术原理,吴恩达出官方课程了

Datawhale干货 最新&#xff1a;吴恩达 Agent Skill 课程如果你最近刷科技圈&#xff0c;一定见过那只红色龙虾——Clawdbot&#xff08;现已改名 OpenClaw&#xff09;。短短一周&#xff0c;12 万 GitHub stars。增长速度快到离谱&#xff0c;社交平台上到处都是开发者在晒截…

作者头像 李华
网站建设 2026/4/18 3:22:50

AI驱动的下一代邮箱安全架构——多层智能防护与高级威胁过滤机制深度剖析

【精选优质专栏推荐】 《AI 技术前沿》 —— 紧跟 AI 最新趋势与应用《网络安全新手快速入门(附漏洞挖掘案例)》 —— 零基础安全入门必看《BurpSuite 入门教程(附实战图文)》 —— 渗透测试必备工具详解《网安渗透工具使用教程(全)》 —— 一站式工具手册《CTF 新手入门实战教…

作者头像 李华