ant-design vue Table表格使用scopedSlots和customRender属性踩坑

ant-design vue Table表格使用scopedSlots和customRender属性踩坑,第1张

问题阐述:本来是要做表格合并的,并且还需要对上面的文字做处理的,类似功能有:合并首列,在文字前面加一个单选框

scopedSlots和customRender不能同时使用
columns: [
        {
          title: "PRODUCT",
          dataIndex: "PRODUCT",
          // scopedSlots: { customRender: "action" },
          customRender: (text, row, index) => {
            const obj = {
              children: (<a href="#" id='queryChildList'>{text}</a>),
              attrs: {},
            };
            obj.attrs.rowSpan = row.mergeRowSpan; //row.mergeRowSpan 是合并几行
            return obj;
          },
        }
 ]

customRender中的children里面使用的是jsx语法,所以不能使用vue中的v-if条件判断

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1296927.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-10
下一篇2022-06-10

发表评论

登录后才能评论

评论列表(0条)

    保存