fix dose't work properly for the first time

This commit is contained in:
msidolphin 2019-03-18 09:22:46 +08:00 committed by GitHub
parent 5b143a2b3f
commit 07ad4da491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,6 +80,9 @@
// window.addEventListener('resize', this.handleScroll, false); // window.addEventListener('resize', this.handleScroll, false);
on(window, 'scroll', this.handleScroll); on(window, 'scroll', this.handleScroll);
on(window, 'resize', this.handleScroll); on(window, 'resize', this.handleScroll);
this.$nextTick(() => {
this.handleScroll();
})
}, },
beforeDestroy () { beforeDestroy () {
// window.removeEventListener('scroll', this.handleScroll, false); // window.removeEventListener('scroll', this.handleScroll, false);