pro-components
pro-components copied to clipboard
🧐[问题] Protable配置menu,在onChange调用刷新列表接口
trafficstars
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🧐 问题描述
当我配置了toolbar中menu的时候,需求是想在改变tab时,重新请求数据,但是在调用reload时,明显感觉到,tabs的渲染有明显的卡顿,当注释了reload时,又显的tab的切换很平滑。
💻 示例代码
toolbar={{
menu: {
type: 'tab',
activeKey,
items: [
{ key: '0', label: <span>申请中(100个)</span> },
{ key: '1', label: <span>已通过(46个)</span> },
{ key: '2', label: <span>不通过(87个)</span> },
],
onChange: key => {
setActiveKey(key);
tableRef.current.reload();
},
}
}
🚑 其他信息
