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

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

方式一
html 复制代码
<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>
css 复制代码
.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;
}
方式二
javascript 复制代码
<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>
css 复制代码
.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;
}
相关推荐
来一碗刘肉面7 分钟前
React - ajax 配置代理
前端·react.js·ajax
bin915317 分钟前
DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)
前端·javascript·vue.js·ecmascript·deepseek
@LitterFisher21 分钟前
Excell 代码处理
前端·javascript·excel
十八朵郁金香2 小时前
【JavaScript】深入理解模块化
开发语言·javascript·ecmascript
m0_748230942 小时前
Redis 通用命令
前端·redis·bootstrap
YaHuiLiang2 小时前
一切的根本都是前端“娱乐圈化”
前端·javascript·代码规范
菜鸟一枚在这3 小时前
深入解析设计模式之单例模式
开发语言·javascript·单例模式
ObjectX前端实验室3 小时前
个人网站开发记录-引流公众号 & 谷歌分析 & 谷歌广告 & GTM
前端·程序员·开源
CL_IN3 小时前
企业数据集成:实现高效调拨出库自动化
java·前端·自动化
浪九天5 小时前
Vue 不同大版本与 Node.js 版本匹配的详细参数
前端·vue.js·node.js