fix: Work 动画最终修复——pinType transform + hydration 后初始化
- 根因1:position:fixed 的 pin 在当前环境失效(元素保持 static), 改为 pinType:'transform'(transform 固定),浏览器实测 pin 生效、卡片堆叠滑动正常 - 根因2:watch immediate 在 hydration 前初始化导致样式被重置,改到 onMounted - 卡片定位用原生 style + DOM 选择器 + 自愈重试 + initedOnce - 本地浏览器逐帧验证:pinTop 恒 0,卡片逐张滑入堆叠(缩放退后/前台/进入)
This commit is contained in:
@@ -125,6 +125,7 @@ const initScrollAnimation = (): boolean => {
|
|||||||
start: 'top top',
|
start: 'top top',
|
||||||
end: () => `+=${(count - 1) * window.innerHeight}`,
|
end: () => `+=${(count - 1) * window.innerHeight}`,
|
||||||
pin: pinEl,
|
pin: pinEl,
|
||||||
|
pinType: 'transform',
|
||||||
scrub: true,
|
scrub: true,
|
||||||
anticipatePin: 1,
|
anticipatePin: 1,
|
||||||
invalidateOnRefresh: true,
|
invalidateOnRefresh: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user