ant design 如何把表格expandIcon 渲染在最后一列固定列上?

新手上路,请多包涵

expandIcon 渲染在其他列都是正常,但是渲染到最后一列固定列上就显示不出来

<a-table
        :columns="columns"
        :data-source="data"
        bordered
        :expandRowByClick="false"
        :expandIconColumnIndex="10"
        :expandIconAsCell="false"
        :expandIcon="(props) => this.customExpandIcon(props)"
        :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        :scroll="{ x: 2000, y: 900 }"
      > </a-table>
customExpandIcon(props) {
      console.log(props)
      // if(props.record.children.length > 0){
      if (props.expanded) {
        return (
          <a
            style={{ color: 'black', marginRight: 8 }}
            onClick={(e) => {
              props.onExpand(props.record, e)
            }}
          >
            <a-button type="link">关闭详情</a-button>
          </a>
        )
      } else {
        return (
          <a
            style={{ color: 'black', marginRight: 8 }}
            onClick={(e) => {
              props.onExpand(props.record, e)
            }}
          >
            <a-button type="link">查看详情</a-button>
          </a>
        )
      }
阅读 427
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题