Open XJQ124 opened 8 months ago
单独为其设了一个state来控制他的这个内容
const GitDiv = () => { const [expand, setExpand] = useState(null) const [rotate, setRotate] = useState(false) const [curIndex, setCurIndex] = useState(null) const toggle = (index) => { console.log('toggle', index) setCurIndex(index) setRotate(preRotate => !preRotate) setExpand(prevIndex => (prevIndex === index ? true : index)); }; //Popover里的内容以及是否可见 const [visiblePopover, setVisiblePopover] = useState(null) const handlePopover = (index, visible) => { if (visible) { setVisiblePopover(index) } else { setVisiblePopover(null) } }
下面相应的也加上curIndex
<CaretDownOutlined style={{ fontSize: 8, marginLeft: 8, marginRight: 8, transform: `rotate(${(rotate && curIndex === index) ? 180 : 0}deg)` }} />
改了一下午,一直出现新的问题,,,
给马老师汇报过了,这里先记录,后面这个bug先放置一下,明天的工作等待安排
任务:修复bug
1、第一个之前一直卡住的翻转的问题解决掉了
单独为其设了一个state来控制他的这个内容
下面相应的也加上curIndex
2、第二个bug死活解决不掉,,,
改了一下午,一直出现新的问题,,,
给马老师汇报过了,这里先记录,后面这个bug先放置一下,明天的工作等待安排