<el-table-column label="评价内容" style="width: 30%;" :show-overflow-tooltip="true">
   <template slot-scope="scope">
      {{ scope.row.content || "-" }}
       <el-tooltip
          :content="scope.row.content"
          placement="top">
       </el-tooltip>
   </template>
</el-table-column>

第一种就是使用 el-tooltip 加上 :show-overflow-tooltip="true" (超出表格长度会自动省略)进行实现,但是这种 tooltip 内容还是过长 还超出了屏幕范围

element中动态Tooltip 内容过长

 

<el-table-column label="评价内容" style="width: 30%;">
   <template slot-scope="scope">
      <el-popover placement="top-start" title="评价内容" width="500" trigger="hover" >
         <div>{{scope.row.content}}</div>
         <span slot="reference">{{ scope.row.content.substr(0,30)+'...' }}</span>
      </el-popover>
   </template>
</el-table-column>

第二种,用 el-popover,substr 限制提示内容 一行的字数,width 可自行调节,trigger 移入事件

element中动态Tooltip 内容过长

 

相关文章:

  • 2021-10-28
  • 2021-11-06
  • 2023-02-02
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案