问题遇到的现象和发生背景
使用antd 2x ,想要将渲染的一列固定为操作,并通过record绑定数据来操做,在官网文档找到对应的教程 , <template #operation="{record}"> 测试显示 record 为undefined
问题相关代码,请勿粘贴截图
<template #operation="{record}">
<a-popconfirm
v-if="dataSource.length"
title="Sure to delete?"
@confirm="test"
>
Delete
运行结果及报错内容
vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read properties of undefined (reading 'record')
我的解答思路和尝试过的方法
我以为是我格式写错了,改成<template #operation> 是可以运行,但是不能达到预期效果,没有该行的相关数据来指定操做
我想要达到的结果
record问题解决或者在不获取record的条件下得到对应行的数据