data () { return { scrolled: false }; }, methods: { handleScroll () { this.scrolled = window.scrollY > 0; } }, ready () { window.addEventListener('scroll', this.handleScroll); }