import { shortcut } from "@/core/decorator"; import { extend, isFunction } from "@/core/2.base"; import { Layout } from "../../layout"; /** * absolute实现的居中布局 * @class FloatAbsoluteCenterLayout * @extends Layout */ @shortcut() export class FloatAbsoluteCenterLayout extends Layout { static xtype = "bi.absolute_center_float"; props() { return extend(super.props(...arguments), { baseCls: "bi-abs-c-fl", }); } render() { super.render(...arguments); const o = this.options; const items = isFunction(o.items) ? this.__watch(o.items, (context, newValue) => { this.populate(newValue); }) : o.items; this.populate(items); } _addElement(i, item) { const w = super._addElement(...arguments); w.element.addClass("bi-abs-c-item").css({ position: "absolute", }); return w; } populate(items) { super.populate(...arguments); this._mount(); } }