Antd design vue 自定义表头


定义列

columns: [
        
        {
          dataIndex: "key",
          key: "x",
          slots: {
            customRender: "customAction",
            title: "customActionTitle"
          }
        }
      ]

模板

<a-table
          :columns="columns"
          :data-source="batchData"
          bordered
          size="small"
          :pagination="false"
        >
          <template #customActionTitle="{  }">
            <PlusOutlined @click="addData()" />
          </template>
          <template #customAction="{ key, record }">
            <MinusOutlined @click="deleteData(key, record.key)" />
          </template>
        </a-table>

  Note:定义列的时候不要定义title


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM