当从ant design官网粘过来的代码#bodyCell="{ column, record }"部分报错
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
</template>
</template>
const columns = [
{
name: 'Name',
dataIndex: 'name',
key: 'name',
},
{
title: 'Age',
dataIndex: 'age',
key: 'age',
},
{
title: 'Address',
dataIndex: 'address',
key: 'address',
},
{
title: 'Tags',
key: 'tags',
dataIndex: 'tags',
},
{
title: 'Action',
key: 'action',
},
];
解决方法:
将上面改为
<template #bodyCell="item">
<template v-if="item?.column.key === 'name'">
报错解决