antd-vue表格内部换行

1.首先在table中添加插槽

            
              
{ { value }}

2.在表格属性中添加scopedSlots

        {
          title: '内容',
          dataIndex: 'txt',
          key: 'txt',
          width: 450,
          scopedSlots: { customRender: 'txt' },

        }, 

3.在数据处理中,将换行分隔符转化为'\n'

desc_txt.replace(/
/g, '\n')

搞定~~~~~

我的理解是~~其实也就是把表格里的东西放到一个html的标签中,然后使其可以解析换行的标签

你可能感兴趣的:(vue-antd)