在使用 ant design 的表格時候使用默認選中項, 需要配置的 Table 的 rowSelection
const rowSelection = {
type: 'checkbox',
getCheckboxProps(record) {
return {
defaultChecked: record.id == 0 // 配置默認勾選的列
}
}
}
可以參考 ant design 的 GitHub 回復 鏈接