Skip to content

表格组件的设置是否展示行展开列不支持根据record来计算true和false #8375

@ty-lq

Description

@ty-lq

version

4.2.6

environment

Chrome/140.0.0.0 vue/3.5.13

Steps to reproduce

	<a-table
		:columns="columns"
		:data-source="data"
		:expanded-row-keys="expandedRowKeys"
		@expand="handleExpand"
		:row-key="(record) => record.id"
		:showExpandColumn="(record) => record.children && record.children.length > 0"
	>
		<template #bodyCell="{ column, record }">
			<template v-if="column.key === 'action'">
				<a-button type="link" size="small" @click="handleAdd(record)">新增</a-button>
				<a-button type="link" size="small" @click="handleEdit(record)">编辑</a-button>
				<a-button type="link" size="small" @click="handleDelete(record)">删除</a-button>
			</template>
		</template>
	</a-table>

这样写控制台报错Invalid prop: type check failed for prop "showExpandColumn". Expected Boolean, got Function

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions