import { shortcut, Widget, createWidget, deepClone } from "@/core"; import { Msg } from "@/base"; @shortcut() export class SingleLevelTree extends Widget { static xtype = "demo.single_level_tree"; render() { const self = this; const tree = createWidget({ type: "bi.single_level_tree", items: deepClone(Demo.CONSTANTS.LEVELTREE), value: "11", }); return { type: "bi.vtape", items: [ { el: tree, }, { el: { type: "bi.button", height: 25, text: "getValue", handler() { Msg.alert("", JSON.stringify(tree.getValue())); }, }, height: 25, }, { el: { type: "bi.button", height: 25, text: "setValue (第二级文件1)", handler() { tree.setValue(["2"]); }, }, height: 25, } ], width: 500, hgap: 300, }; } }