import { shortcut, Widget, deepClone } from "@/core"; import { Msg } from "@/base"; @shortcut() export class SingleTreeCombo extends Widget { static xtype = "demo.single_tree_combo"; props = { baseCls: "demo-exceltable" }; render() { const self = this; const items = deepClone(Demo.CONSTANTS.LEVELTREE); return { type: "bi.horizontal_auto", items: [ { type: "bi.single_tree_combo", ref(_ref) { self.tree = _ref; }, defaultText: "请选择", items, width: 300, value: "11", }, { type: "bi.button", text: "getVlaue", handler() { Msg.toast(self.tree.getValue()[0]); }, width: 300, }, { type: "bi.button", text: "setVlaue (第二级文件1)", handler() { self.tree.setValue(["2"]); }, width: 300, } ], vgap: 20, }; } }