数据中有 type 字段,需根据值取出显示项,customRender中用this访问不到data中定义的数组,将数组定义在script中就可以了

<script>
 let liveTypes = [];
 export default {
 ...
  data() {
      return {
       innerColumns: [
       ...
        {
            title: '类型',
            align: 'center',
            dataIndex: 'liveType',
            customRender: function (text, record, index) {
              for (let i = 0; i < liveTypes.length; i++) {
                if (liveTypes[i].value == record.liveType) {
                  return liveTypes[i].text;
                }
              }
              return text;
            }
          }
Logo

前往低代码交流专区

更多推荐