fix cannot read offset of undefined on anchor component

This commit is contained in:
anymost 2019-04-15 11:37:30 +08:00
parent 77a67f5d3f
commit 0f0a9fe610

View file

@ -168,7 +168,9 @@ export default {
this.handleScrollTo();
this.handleSetInkTop();
this.updateTitleOffset();
if (this.titlesOffsetArr[0]) {
this.upperFirstTitle = this.scrollElement.scrollTop < this.titlesOffsetArr[0].offset;
}
on(this.scrollContainer, 'scroll', this.handleScroll);
on(window, 'hashchange', this.handleHashChange);
});