mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-05-08 06:38:37 +08:00
30 lines
526 B
JavaScript
30 lines
526 B
JavaScript
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
labelContent: cc.Label
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
},
|
|
|
|
init(args, fn) {
|
|
console.log(args);
|
|
let content = args.content;
|
|
this.labelContent.string = content;
|
|
if (fn) this.fn = fn;
|
|
},
|
|
|
|
onEventClicked_ok(event) {
|
|
try {
|
|
if (this.fn) {
|
|
this.fn(event);
|
|
}
|
|
} catch (error) {
|
|
console.log('PageUi err=', error);
|
|
}
|
|
this.node.destroy();
|
|
}
|
|
|
|
}); |