Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对反应很陌生,想在主要反应数据表中处理行展开/折叠。我试图一次只扩大一排
const onRowToggle = ( e) => { setExpandedRows(e.data); }
我为此目的使用上面的行。请帮忙!
如果您只想扩展一行,onRowToggle请从DataTable组件中删除并实现以下onRowExpand方法
onRowToggle
DataTable
onRowExpand
onRowExpand(event) { setExpandedRows({ [event.data.id]: true }); }