fix(page-scroll): skip when page undefined (#4640)

* fix(page-scroll): skip when page undefined

* fix: adjust
This commit is contained in:
nemo-shen 2021-11-30 14:23:41 +08:00 committed by GitHub
parent a7dd166829
commit e5089f464b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {