vue3·Antdv-UI 组件Table 表格获得索引

Antdv UI 获取a-table 表格的索引 index

卡槽 #bodyCell 属性 index 即是当前表格索引

<template><!-- Antdv 表格  -->
	<a-table :columns="columns" :data-source="data" :scroll="{ x: 100, y: 500 }" >
		<template #bodyCell="{column,record,index}" > //卡槽 index 索引属性
			<template v-if="column.key === 'operation'">
				<a @click="tapClick(record,index)">操作</a> //index即是当前表单索引
			</template>
		</template>
	</a-table>
</template>
1,256 Views
分享你的喜爱
linwute
linwute

我要像梦一样自由,像大地一样宽容;
在艰辛放逐的路上,点亮生命的光芒;
我要像梦一样自由,像天空一样坚强;
在曲折蜿蜒的路上,体验生命的意义;

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注