UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

33 lines (32 loc) 889 B
import { Button } from "./Button"; export class CheckBox extends Button { constructor(skin = null, label = "") { super(skin, label); this.toggle = true; this._autoSize = false; } preinitialize() { super.preinitialize(); this.toggle = true; this._autoSize = false; } initialize() { super.initialize(); this.createText(); this._text.align = "left"; this._text.valign = "top"; this._text.width = 0; } set dataSource(value) { this._dataSource = value; if (value instanceof Boolean) this.selected = value; else if (typeof (value) == 'string') this.selected = value === "true"; else super.dataSource = value; } get dataSource() { return super.dataSource; } }