Skip to content

Commit

Permalink
fix: 初始化优化
Browse files Browse the repository at this point in the history
  • Loading branch information
kongjing@dian.so authored and kongjing@dian.so committed Nov 29, 2022
1 parent 831d642 commit b13c541
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vantui/src/collapse-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function CollapseItem(
setDomHeight(res.height)
})
})
}, [children, compIndex])
}, [children])

useLayoutEffect(() => {
if (domHeight !== -1) {
Expand All @@ -74,6 +74,8 @@ export function CollapseItem(
setCurrHeight('0px')
}, 10)
}
} else {
setCurrHeight('0px')
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isOpen, domHeight])
Expand Down

0 comments on commit b13c541

Please sign in to comment.