替换:show-overflow-tooltip=“true“ ,使用插槽tooltip,达到内容可复制

原生的show-overflow-tooltip="true" 不能满足条件,使用插槽自定义编辑;

旧code

javascript 复制代码
<el-table-column prop="reason" label="原因" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="params" label="参数" align="center" :show-overflow-tooltip="true" />

新code

javascript 复制代码
<el-table-column prop="reason" label="原因" align="center">
  <template slot-scope="scope">
    <el-tooltip class="item" effect="dark" placement="top-start">
      <div slot="content">{{ scope.row.reason }}</div>
      <div style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
        {{ scope.row.reason }}
      </div>
    </el-tooltip>
  </template>
</el-table-column>
<el-table-column prop="params" label="参数" align="center">
  <template slot-scope="scope">
    <el-tooltip class="item" effect="dark" placement="top-start">
      <div slot="content">{{ scope.row.params }}</div>
      <div style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
        {{ scope.row.params }}
      </div>
    </el-tooltip>
  </template>
</el-table-column>

新css样式

css 复制代码
.el-tooltip__popper {
  max-width: 500px !important; /* 你想要的宽度 */
}

效果

相关推荐
森林的尽头是阳光6 天前
tree回显问题
javascript·vue.js·elementui
Bad_Shepherd7 天前
vue-element-plus-admin添加自定义svg图标,并且图标选择组件可选自定义图标
vue.js·elementui·前端框架
不甘平凡的小鸟13 天前
Element-UI记录
javascript·vue.js·ui·elementui
chushiyunen1 个月前
vue el-pagination实现分页
javascript·vue.js·elementui
一坨阿亮1 个月前
使用e-tree开发树形穿梭框
javascript·vue.js·elementui
北极星日淘2 个月前
可买免税店货物与安耐晒——特殊商品代购技术方案
javascript·vue.js·elementui
chushiyunen2 个月前
vue插件element ui,element plus,ElMessage消息框,ref,动态绑定语法
vue.js·ui·elementui
流浪码农~2 个月前
Element Plus DatePicker 动态设置每周起始日
前端·vue.js·elementui
依托偶尔宁2 个月前
element-plus:el-table设置展开图标所在列的位置
前端·elementui
吠品2 个月前
PyTorch 踩坑:libtorch_cpu.so 找不到 iJIT_NotifyEvent 符号
前端·vue.js·elementui