在网上看到这么一个例子,用on去绑定,但是on不是jQuery的方法吗?在Vue中可以直接写on吗?为什么我用addEventListener会不支持此方法? let that = this; this.button1.on('click',function(e){ this.addClass('on'); //this指代所点的元素 that.doSomething(); //that指向类的this })
添加回答
举报
0/150
提交
取消