Vue: Vue2.0 is used with jQuery1.12. The jQuery click event is disabled

Created on 6 Dec 2016  ·  2Comments  ·  Source: vuejs/vue

Vue.js version
2.0.2





three

onetwo
four


$(document).ready(function(){ $("#table1").find("tbody").click(function() { console.log('click running@@'); }); var vm = new Vue({ el:"#table1", methods: { } }); });
When you do not call vue, the click event can be executed, call vue, click event can not be executed, vue2.0 and jquery can not be used together?

Most helpful comment

Note: @wgq837051 I already replied to your first issue with the same question one hour earlier.

Please don't open any more issues for this

Support/Help: http://forum.vuejs.org

All 2 comments

Please make sure to read the Issue Reporting Guidelines before opening new issues. Questions should be posted on the forum or StackOverflow. Thanks.


Vue 2 replaces your dom and therefore dom events like the click one are replaced. You should put the jquery manipulation in the mounted event. You can also google for examples, there're many

Note: @wgq837051 I already replied to your first issue with the same question one hour earlier.

Please don't open any more issues for this

Support/Help: http://forum.vuejs.org

Was this page helpful?
0 / 5 - 0 ratings