We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e096e7 commit b8dea51Copy full SHA for b8dea51
src/affix/affix.tsx
@@ -30,10 +30,12 @@ export default defineComponent({
30
} else {
31
_containerHeight = scrollContainer.value.clientHeight;
32
}
33
- if (!instance.ctx || instance.ctx.$el) return;
+ if (!instance.ctx || instance.ctx.$el) {
34
+ handleScroll();
35
+ return;
36
+ }
37
// 需要减掉当前节点的高度,对比的高度应该从 border-top 比对开始
38
containerHeight.value = _containerHeight - (instance.ctx.$el?.clientHeight || 0);
- if (instance.ctx.$el) return;
39
// 被包裹的子节点宽高
40
const { clientWidth, clientHeight } = instance.ctx.$el?.querySelector(`.${name}`) || instance.ctx.$el;
41
oldWidthHeight.value = { width: `${clientWidth}px`, height: `${clientHeight}px` };
0 commit comments