ant design vue table表格插槽slot问题

在做表格时我们想操作表格怎么插入那些操作呢?

这是官网给出的例子https://www.antdv.com/components/table-cn/

不熟悉的人,肯定看得一脸懵逼,下面是我写的插槽,仅供参考

     <a-table
        :pagination="paginationOpt"
        :columns="columns1"
        :dataSource="data1"
        :rowKey="record => record.id"
        size="small"
      >
        <div
          slot="operation"
          slot-scope="text, record"
          style="display: flex;justify-content: space-around"
        >
          <!-- 查看 -->
          <detail-form
            :rowdata="record"
            :refreshItem="refreshItem"
          ></detail-form>
         <!-- 删除 -->
          <a
            @click="showDeleteConfirm(record)"
          >删除</a>
        </div>
      </a-table>

  slot="operation" 表示是在columns(某列)中的表头值为operation中插入标签‘查看’和‘删除’操作,如果想切换成按钮,把<a></a>修改成<button></button>

 :rowdata="record" 表示当前行的数据,可以通过传递record来换取到当前行所有的数据

  :refreshItem="refreshItem" 用于刷新用的方法,想了解可翻看下一篇refreshItem

 

  • 10
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值