一、 首先看效果图:
二、示例代码:
代码语言:javascript复制<el-table-column prop="safetyRisk" label="安全隐患" width="200">
<template slot-scope="scope">
<el-popover
placement="top-start"
title="安全隐患"
width="300"
trigger="hover"
>
<div>{{ scope.row.safetyRisk }}</div>
<span slot="reference">{{
scope.row.safetyRisk.substr(0, 30) "..."
}}</span>
</el-popover>
</template>
</el-table-column>
参考 https://www.jianshu.com/p/7e7b65b99f3d