Skip to content

Commit

Permalink
fix: opacity:0 注入条件
Browse files Browse the repository at this point in the history
  • Loading branch information
lareinayanyu committed Dec 6, 2024
1 parent a01f03d commit 77e6188
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ interface LayoutConfig {
export const useLayout = ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
const layoutRef = useRef({})
const hasLayoutRef = useRef(false)
const layoutStyle: Record<string, any> = !hasLayoutRef.current && hasSelfPercent ? HIDDEN_STYLE : {}
const isFistRender = useRef(true)
const layoutStyle: Record<string, any> = isFistRender && !hasLayoutRef.current && hasSelfPercent ? HIDDEN_STYLE : {}
const layoutProps: Record<string, any> = {}
const enableOffset = props['enable-offset']
if (hasSelfPercent || onLayout || enableOffset) {
Expand All @@ -507,6 +508,7 @@ export const useLayout = ({ props, hasSelfPercent, setWidth, setHeight, onLayout
props.onLayout && props.onLayout(e)
}
}
isFistRender.current = false
return {
layoutRef,
layoutStyle,
Expand Down

0 comments on commit 77e6188

Please sign in to comment.