You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
import { shortcut, Widget, createWidget } from "@/core"; |
|
|
|
@shortcut() |
|
export class Func extends Widget { |
|
static xtype = "demo.display_tree"; |
|
|
|
props = { baseCls: "demo-func" }; |
|
|
|
render() { |
|
const tree = createWidget({ |
|
type: "bi.display_tree", |
|
element: this, |
|
}); |
|
|
|
tree.initTree([ |
|
{ |
|
id: 1, |
|
text: "第一项", |
|
open: true, |
|
}, |
|
{ |
|
id: 2, |
|
text: "第二项", |
|
}, |
|
{ |
|
id: 11, |
|
pId: 1, |
|
text: "子项1(共2个)", |
|
open: true, |
|
}, |
|
{ |
|
id: 111, |
|
pId: 11, |
|
text: "子子项1", |
|
}, |
|
{ |
|
id: 112, |
|
pId: 11, |
|
text: "子子项2", |
|
}, |
|
{ |
|
id: 12, |
|
pId: 1, |
|
text: "子项2", |
|
}, |
|
{ |
|
id: 13, |
|
pId: 1, |
|
text: "子项3", |
|
} |
|
]); |
|
} |
|
}
|
|
|