el-table-column单元格内容换行,tooltip样式更改

初始化数据(数组对象):

tableData:[

{

associated_subject:  ['刘杰', '公司名称'],

issuer: ['刘红',''张三','公司名称']

num_value: 134472.64

petition_summary: "测试数据"

},

]

 

html代码

<el-table :data="tableData"  border height="520" style="width: 100%">

               <el-table-column prop="petition_summary" label="测" class="petition_summary" :show-overflow-tooltip="true" />

               <el-table-column  label="测试" width="240">

                  <template v-slot="scope">

                    <div  v-for="(item,index) in scope.row.issuer"  :key="item.label">

                      <div  :data-title="item" class="content-text">{{scope.row.issuer.length>1?index+1+'.':''}}  {{item}}</div>

                    </div>

                </template>

               </el-table-column>

               <el-table-column label="测试2" width="240">

                  <template v-slot="scope">

                    <div v-for="(item,index) in scope.row.associated_subject"  :key="item.label"  >

                      <div :data-title="item" class="content-text" >{{scope.row.associated_subject.length>1?index+1+'.':''}}  {{item}}</div>

                    </div>

                </template>

               </el-table-column>

               <el-table-column prop="num_value" label="测试4" width="150" />

             </el-table>

1.如果只需给当前单元格做tooltip,直接在el-table-column加 :show-overflow-tooltip="true" 即可

2.动态渲染需要拆分单元格,展示出来比较难看,又想换行还需要每列单独展示的情况,可以参照上面  <template>中的代码

3.tooltip展示效果  修改默认的样式

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值