scope of this keyword in vue js
<script>
export default {
mounted() {
this.myMethod()
},
methods:{
myMethod() {
let _this = this
let self = this
let that = this
window.addEventListener('click', function() {
console.log('this scope (function) >', this)
console.log('this scope (vuejs) >', _this)
console.log('this scope (vuejs) >', self)
console.log('this scope (vuejs) >', that)
})
}
}
}
</script>