You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
635 B
TypeScript
32 lines
635 B
TypeScript
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class DetailPanelItem extends cc.Component {
|
|
@property(cc.Label)
|
|
keyLabel: cc.Label = null;
|
|
|
|
@property(cc.Label)
|
|
valueLabel: cc.Label = null;
|
|
|
|
protected _keyName: string = '';
|
|
|
|
get keyName(): string {
|
|
return this._keyName
|
|
}
|
|
|
|
set keyName(key: string) {
|
|
this._keyName = key
|
|
}
|
|
|
|
setItemInfo(key: string, value: string) {
|
|
this.keyLabel.string = key
|
|
this.valueLabel.string = value
|
|
this.keyName = key
|
|
}
|
|
|
|
updateItemInfo(value: string) {
|
|
this.valueLabel.string = value
|
|
}
|
|
}
|