a-table中getCheckboxProps的使用实现禁用表格中指定条目不可选

示例

code

<a-table
style="height: 520px"
size="small"
:row-selection="{
getCheckboxProps: getCheckboxProps,
onChange: onSelectChange,
selectedRowKeys: state.selectedRowKeys,
}"
v-if="state.activeKey === tab.key"
:loading="state.tableLoading"
:rowKey="(record) => record.id"
:columns="tab.cols"
:dataSource="tab.tableData"
:scroll="{ x: 1500, y: 500 }"
:pagination="pagination"
>
const getCheckboxProps = (record) => ({
disabled: record.shoppingFlag, // Column configuration not to be checked
})
posted @   Felix_Openmind  阅读(942)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
*{cursor: url(https://files-cdn.cnblogs.com/files/morango/fish-cursor.ico),auto;}
点击右上角即可分享
微信分享提示