Yes, I already know 9028924 people will mark this as duplicate question within 8 seconds of posting. Believe me... I've googled for close to an hour now, or I wouldn't be asking.
methods: {
stylizeHeader: debounce(event => {
if (event.target.scrollTop <= 1 && !this.scrolled) {
this.scrolled = true;
console.log('true');
} else if (this.scrolled) {
this.scrolled = false;
console.log('false');
}
}, 20),
},
I'm using Vue, and all I'm trying to do is access the this
property in the debounce function as it relates to the outer scope (a Vue implementation detail). The problem is obviously the arrow function.
I can't find the proper syntax. I've tried every permutation I can think of with () { }
If I use function() { }
it works fine, but eslint complains (so I want to follow good up to date conventions).
How do I literally just write it in ES6 so I can access this
.