diff --git a/packages/index-bar/index.ts b/packages/index-bar/index.ts index 6ec0274c..67372cac 100644 --- a/packages/index-bar/index.ts +++ b/packages/index-bar/index.ts @@ -101,6 +101,9 @@ VantComponent({ setListRect() { return getRect(this, '.van-index-bar').then((rect) => { + if (!isDef(rect)) { + return; + } Object.assign(this, { height: rect.height, top: rect.top + this.scrollTop,