index-bar 在wx:if为false时, 抛异常

This commit is contained in:
GRANDSOFT\baosc 2021-10-27 17:22:39 +08:00
parent 47c66d38e3
commit f2080a3b3b

View File

@ -101,6 +101,9 @@ VantComponent({
setListRect() { setListRect() {
return getRect(this, '.van-index-bar').then((rect) => { return getRect(this, '.van-index-bar').then((rect) => {
if (!isDef(rect)) {
return;
}
Object.assign(this, { Object.assign(this, {
height: rect.height, height: rect.height,
top: rect.top + this.scrollTop, top: rect.top + this.scrollTop,