[Vuejs]-JQuery click event stops working after added a loader to Vue object

2👍

There’s no reason to be writing your event handlers in jQuery. Modifying the DOM externally to Vue will always be problematic, because Vue doesn’t know about those modifications, so your event bindings and any other external changes will be thrown away whenever Vue needs to re-render that portion of the DOM.

If you’re using Vue, use Vue.

<a href="#" v-on:click="foo">
    <img :src="project.image_src" :alt="project.image_alt">
</a>

...

methods: {
    foo() {
       // your click handler code here
    }
}

Leave a comment