方法一
因為 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)
}