如果被单击的元素不是canvas
元素,则此Meteor客户端代码将尝试应用click事件。它没有做到这一点,怎么才能解决呢?
Template.myTemp.events({
'click :not("canvas")': function(e) {
console.log('clicked');
}
});
您要选择所有不是<canvas>
(:not(canvas)
,无引号)的元素(*
):
Template.myTemp.events({
'click *:not(canvas)': function(e) {
console.log('clicked');
}
});