From e5089f464b06688ef48f79431a86d02b560eb6c4 Mon Sep 17 00:00:00 2001 From: nemo-shen Date: Tue, 30 Nov 2021 14:23:41 +0800 Subject: [PATCH] fix(page-scroll): skip when page undefined (#4640) * fix(page-scroll): skip when page undefined * fix: adjust --- packages/mixins/page-scroll.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/mixins/page-scroll.ts b/packages/mixins/page-scroll.ts index ffb9662d..ae790aaa 100644 --- a/packages/mixins/page-scroll.ts +++ b/packages/mixins/page-scroll.ts @@ -24,6 +24,10 @@ export const pageScrollMixin = (scroller: Scroller) => attached() { const page = getCurrentPage<{ vanPageScroller: Scroller[] }>(); + if (!isDef(page)) { + return; + } + if (Array.isArray(page.vanPageScroller)) { page.vanPageScroller.push(scroller.bind(this)); } else {