elementui table超出两行显示...鼠标已入tip显示

elementui el-table超出两行显示…鼠标已入tip显示

方式一
<el-table-column 
        label="描述"
        prop="note"
        class-name="myNoteBox"
      >
        <template slot-scope="scope">
          <!-- tips悬浮提示 -->
           <el-tooltip placement="top">
            <div slot="content" class="table-tip-box" >
              {{ scope.row.text}}
            </div>
            <div class="table-ellipsis">{{ scope.row.text}}</div>
          </el-tooltip>  
   </template>
 </el-table-column>
.table-ellipsis {
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2;
}
// 提示框的最大宽度
.table-tip-box {
  max-width: 500px;
}

方式二
<el-table-column
        v-if="false"
        label="描述"
        prop="note"
        class-name="myNoteBox"
      >
        <template slot-scope="scope"> 
       <el-popover
            placement="top-start" 
            width="200"
            trigger="hover"
            :content="scope.row.text"
          >
            <div slot="reference" class="twoLineCls">
              {{ scope.row.text}}
            </div>
          </el-popover> 
        </template>
      </el-table-column>
.twoLineCls {
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-14 23:44:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-14 23:44:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-14 23:44:01       87 阅读
  4. Python语言-面向对象

    2024-06-14 23:44:01       96 阅读

热门阅读

  1. web基础与http协议

    2024-06-14 23:44:01       29 阅读
  2. 什么是虚拟展厅?有何优势和特点?

    2024-06-14 23:44:01       27 阅读
  3. 【C语言中的科学计数法】

    2024-06-14 23:44:01       30 阅读
  4. 语义分割的数据集各式

    2024-06-14 23:44:01       31 阅读
  5. HBase中的CRUD

    2024-06-14 23:44:01       39 阅读
  6. (5)按钮输入

    2024-06-14 23:44:01       35 阅读
  7. 【Docker】Docker 配置镜像加速

    2024-06-14 23:44:01       30 阅读
  8. Python - 处理电子书的库

    2024-06-14 23:44:01       36 阅读
  9. 英伟达算法岗面试,问的贼专业。。。

    2024-06-14 23:44:01       39 阅读
  10. UE5.3报错

    2024-06-14 23:44:01       36 阅读
  11. 主成分分析学习

    2024-06-14 23:44:01       34 阅读
  12. 建造者模式

    2024-06-14 23:44:01       38 阅读
  13. 类android设备reset过程

    2024-06-14 23:44:01       28 阅读
  14. android 14.0 控制wifi启用禁用功能实现

    2024-06-14 23:44:01       38 阅读
  15. C Primer Plus第八章学习笔记以及编程题

    2024-06-14 23:44:01       27 阅读