laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
40 lines (39 loc) • 1.08 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Radio = void 0;
const Event_1 = require("../events/Event");
const Button_1 = require("./Button");
class Radio extends Button_1.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_1.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;
}
}
exports.Radio = Radio;