activated () {
window.addEventListener('scroll', this.handleScroll)
},
deactivated () {
window.removeEventListener('scroll', this.handleScroll)
}
全局事件会影响到其他的组件所以要解绑,
activated生命周期钩子是用了keep-alive才有的,每次页面刷新都得会加载
activated () {
window.addEventListener('scroll', this.handleScroll)
},
deactivated () {
window.removeEventListener('scroll', this.handleScroll)
}
全局事件会影响到其他的组件所以要解绑,
activated生命周期钩子是用了keep-alive才有的,每次页面刷新都得会加载