<a-table
        bordered
        :key="tableKey"
        :rowKey="
              (record) => {
                  return record.id
              }
          "
        :columns="referenceColumns"
        :data-source="referenceList"
        :loading="loading"
        :pagination="pagination"
        :expandIcon="expandIcon" 
        @change="(current) => this.listenSizeChange(current)"
      >
        <p
          slot="expandedRowRender"
          slot-scope="record"
        >
          {{ record.content }}
        </p>
      </a-table>

注意:expandIcon="expandIcon", 其中expandIcon需要在methods中定义

 expandIcon(props) {
      if (props.expanded) {
        return (
          <a-icon
            title="点击关闭详细"
            type="minus"
            onClick={(e) => {
              props.onExpand(props.record, e);
            }}
          />
        );
      } else {
        return (
          <a-icon
            title="点击查看详细"
            type="plus"
            onClick={(e) => {
              props.onExpand(props.record, e);
            }}
          />
        );
      }
    },

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐