方法一
因为 keep-alive 组件
多了一个 activated 生命周期
方法二
代码
mounted () {
window.addEventListener('scroll', this.handleScroll)
},
unmounted () {
window.removeEventListener('scroll', this.handleScroll)
}
因为 keep-alive 组件
多了一个 activated 生命周期
mounted () {
window.addEventListener('scroll', this.handleScroll)
},
unmounted () {
window.removeEventListener('scroll', this.handleScroll)
}