Ant Design vue 表格内换行

 data() {
    return {
      // 表头
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          // width: 50,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '名称',
          align: 'center',
          dataIndex: 'name',
          // width: 150,
          className: "TdMordLine",
        },
        {
          title: '时间',
          align: 'center', 
          dataIndex: '', 
          //  width: 50,
            customRender: function(text, record, index) {
                 // 返回数据时,字符串拼接,避免数据为空时,当前列缺失
          // this.dataSource.forEach((item,index)=>{
          //   if(item.licenseIssuingDate && item.licenseValidDate){
          //     item['lineDate']=item.licenseIssuingDate+','+item.licenseValidDate; //换行添加新变量
          //   }else{
          //     item['lineDate']='';
          //   }
          // })
            if(record.lineDate){
               const textArr = record.lineDate.split(',')
                return (
{ textArr.map(t => { return (
  • {t}
  • ) }) }
    ) } } }], } }

    你可能感兴趣的:(webview)