- 定义变量
const [tableParams, setTableParams] = useState<TableParams>({
pagination: {
current: 1,
pageSize: 10,
},
name: '',
assetType: '',
ip: '',
})
2.更新值
let params ={
name: '5555',
}
setTableParams((prevState: any) => {
return { ...prevState, ...params };
});
网友评论