我在组件的构造函数中写:在模拟器中运行有错误,不起作用。
ctor:function(){
cc.log("这是card 的构造函数");
this.node.on('touchstart', function (event) {
cc.log("你摸了我");
});
},

这是怎么回事呢?
我在组件的构造函数中写:在模拟器中运行有错误,不起作用。
ctor:function(){
cc.log("这是card 的构造函数");
this.node.on('touchstart', function (event) {
cc.log("你摸了我");
});
},

这是怎么回事呢?
组件没有构造函数,只有 onLoad start update…
你把代码写在 onLoad 或者 start 一下试看看、
不懂的先看看官方文档