0
点赞
收藏
分享

微信扫一扫

如何选择合适的 AWS 区域对网站性能和成本?

心智的年轮 2024-06-17 阅读 7

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;
}
举报

相关推荐

0 条评论