data () { return { scrolled: false } }, ready () { window.addEventListener('scroll', this.handleScroll); }, methods:{ handleScroll () { this.scrolled = window.scrollY; console.log(this.scrolled) }, }, destroyed () { window.removeEventListener('scroll', this.handleScroll) }, created: function () { window.addEventListener('scroll', this.handleScroll) }