methods:{ handleScroll(){ console.log(document.documentElement.scrollTop) } }, activated(){ window.addEventListener('scroll',this.handleScroll) }
activated, deactivated the life cycle of these two functions must be in use will be after the keep-alive component, otherwise not exist.
Is used in routing the outlet housing <keep-alive>