Answers for "vue use this inside function"

0

vue use this inside function

<script>
export default {
    mounted() {
        this.myMethod()
    },
    methods:{
        myMethod() {
            window.addEventListener('click', function() {
                console.log('this scope (vuejs) >', this)
            }.bind(this))
        }
    }
}
</script>
Posted by: Guest on April-15-2021

Browse Popular Code Answers by Language