当前位置:网站首页>antd table+checkbox 默认值显示
antd table+checkbox 默认值显示
2022-07-27 10:22:00 【会跳舞的小猴子】

在antd 官网我使用的是defaultSelectedRowKeys,页面对默认数值进行了反显
但是在我的代码中并不好使
我用了selectedRowKeys
<Table className='table-cy'
rowSelection={
{
type:"checkbox",
selectedRowKeys:arr,
defaultSelectedRowKeys:["1391713813278482433"],
...rowSelection,
}}
columns={
this.state.columnsTable}
dataSource={
userList}
scroll={
{
y: 292}}
rowKey='id'
pagination={
false}
selectedRows={
this.onChangeAll}
/>
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
this.state.selectedUsers = selectedRowKeys
this.state.selectedUserRow = selectedRows
console.log(selectedRowKeys, selectedRows)
this.setState({
arr:selectedRowKeys
})
},
getCheckboxProps: record => ({
defaultChecked: record.selected === 1, // 配置默认勾选的列
}),
};

即可反显
边栏推荐
- jvm--字节码浅析
- [brother hero June training] day 28: dynamic planning
- 已解决SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated
- 基于Spark封装的二次开发工程edata-base,介绍
- 分布式块设备复制:客户端
- MySQL master-slave architecture, read-write separation, and high availability architecture
- ctf (hardrce)
- Echats关系图les-miserables的图表详细解析(和弦图)
- MySQL deadlock, pessimistic lock, optimistic lock
- Redis数据结构分析(二)
猜你喜欢

Beijing publicized the spot check of 8 batches of children's shoes, and qierte was listed as unqualified

Shardingproxy sub database and table actual combat and comparison of similar products

warning package.json: No license field报错

TDengine 助力西门子轻量级数字化解决方案 SIMICAS 简化数据处理流程

Metaaploit post penetration technology knowledge

phpstudy中Apache无法启动

Gamer questions

Matlab low-level source code realizes the median filtering of the image (used to eliminate some miscellaneous points on the image)

Your appearance is amazing! Two JSON visualization tools are recommended for use with swagger. It's really fragrant

深度解析:什么是Diffusion Model?
随机推荐
深度解析:什么是Diffusion Model?
[Select] how to write PHP code perfectly?
php生成文字图片水印
Overview of user space lock on mobile platform
Tdengine helps Siemens' lightweight digital solution simicas simplify data processing process
阿里邮箱web端登录转圈的处理
gyp ERR! configure error. gyp ERR! stack Error: gyp failed with exit code: 1
Mysql死锁、悲观锁、乐观锁
[brother hero June training] day 25: tree array
多点双向重发布和路由策略
一次跨域问题的记录
Voice data acquisition - real time voice data visualization
Set up Samba service
想要一键加速ViT模型?试试这个开源工具!
Metasploit Eternal Blue attack
Matlab draws the system response under different damping
[Linux] install MySQL
Server access speed
gyp ERR! configure error. gyp ERR! stack Error: gyp failed with exit code: 1
【Liunx】MariaDB/MySQL定时全量备份脚本及数据恢复