zoukankan      html  css  js  c++  java
  • tooltip 可算修复了~ view-design 的 table 的cell.vue

    tooltip 可算修复了~ view-design 的 table 的cell.vue

    就这个bug可是有年头了,可算是修复了
    ViewUI/src/components/table/cell.vue
    https://github.com/view-design/ViewUI/blob/master/src/components/table/cell.vue

    不过高手就是高手,用的 document.createRange 进行修复的。

    <template v-if="column.tooltip">
                    <Tooltip transfer :content="row[column.key]" :theme="column.tooltipTheme ? column.tooltipTheme : tableRoot.tooltipTheme" :disabled="!showTooltip" :max-width="column.tooltipMaxWidth ? column.tooltipMaxWidth : tableRoot.tooltipMaxWidth" class="ivu-table-cell-tooltip">
                        <span ref="content" @mouseenter="handleTooltipIn" class="ivu-table-cell-tooltip-content">{{ row[column.key] }}</span>
                    </Tooltip>
                </template>
    
    handleTooltipIn () {
                   const $content = this.$refs.content;
                   let range = document.createRange();
                   range.setStart($content, 0);
                   range.setEnd($content, $content.childNodes.length);
                   const rangeWidth = range.getBoundingClientRect().width;
                   this.showTooltip = rangeWidth > $content.offsetWidth;
                   range = null;
               },
    
    ---------------------------------------------
    生活的意义并不是与他人争高下,而在于享受努力实现目标的过程,结果是对自己行动的嘉奖。
    ↑面的话,越看越不痛快,应该这么说:

    生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
  • 相关阅读:
    动软代码生成器
    today
    命令执行漏洞
    Linux基础命令(二)
    动态主机配置协议DHCP
    Linux基础(一)
    ARP通信
    IP网段的判断
    配置yum源
    centos7-配置阿里yum源安装nginx
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/14547937.html
Copyright © 2011-2022 走看看