设置页面的样式
onRow={
(record)=>{
return {
onClick:()=>{
holidayIdRef.current = record.id
setHolidayId(holidayIdRef.current);
loadDetailList(record.id)
},
onMouseEnter: () => {
setRowClassName(record);
},
}
}
} rowClassName={setRowClassName}>
属性控制
const setRowClassName:any = (record:any,index:number)=>{
return record.id === holidayId ? `${styles['flag']}` : '';
}
根据不同属性设置不同的样式