Files
CocosCreatorTutorial/PomeloClient/assets/Script/view/chat/ChatItem.js
2018-08-22 10:57:12 +08:00

26 lines
470 B
JavaScript

const timeUtil = require('TimeUtil');
cc.Class({
extends: cc.Component,
properties: {
timeLabel: cc.Label,
nameLabel: cc.Label,
contextLabel: cc.Label
},
onLoad() {
},
init(data) {
this.contextLabel.node.active = false;
this.timeLabel.string = timeUtil.timeString(new Date());
this.nameLabel.string = data.name + ' : ' + data.msg;
}
// start () {
// },
// update (dt) {},
});