laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
36 lines (35 loc) • 934 B
JavaScript
import { Event } from "../events/Event";
import { Button } from "./Button";
export class Radio extends Button {
constructor(skin = null, label = "") {
super(skin, label);
this.toggle = false;
this._autoSize = false;
}
destroy(destroyChild = true) {
super.destroy(destroyChild);
this._value = null;
}
preinitialize() {
super.preinitialize();
this.toggle = false;
this._autoSize = false;
}
initialize() {
super.initialize();
this.createText();
this._text.align = "left";
this._text.valign = "top";
this._text.width = 0;
this.on(Event.CLICK, this, this.onClick);
}
onClick(e) {
this.selected = true;
}
get value() {
return this._value != null ? this._value : this.label;
}
set value(obj) {
this._value = obj;
}
}