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.
73 lines
2.2 KiB
73 lines
2.2 KiB
import { shortcut, Widget, createWidget, createItems } from "@/core"; |
|
|
|
@shortcut() |
|
export class Func extends Widget { |
|
static xtype = "demo.switcher"; |
|
|
|
props = { baseCls: "demo-func" }; |
|
|
|
render() { |
|
const adapter = createWidget({ |
|
type: "bi.label", |
|
cls: "layout-bg2", |
|
text: "将在该处弹出switcher", |
|
}); |
|
createWidget({ |
|
type: "bi.absolute", |
|
element: this, |
|
items: [ |
|
{ |
|
el: adapter, |
|
top: 50, |
|
left: 20, |
|
width: 200, |
|
height: 300, |
|
} |
|
], |
|
}); |
|
createWidget({ |
|
type: "bi.vertical", |
|
element: this, |
|
hgap: 30, |
|
vgap: 20, |
|
items: [ |
|
{ |
|
type: "bi.switcher", |
|
el: { |
|
type: "bi.button", |
|
height: 25, |
|
text: "Switcher", |
|
}, |
|
popup: { |
|
cls: "mvc-border layout-bg5", |
|
items: createItems( |
|
[ |
|
{ |
|
text: "项目1", |
|
value: 1, |
|
}, |
|
{ |
|
text: "项目2", |
|
value: 2, |
|
}, |
|
{ |
|
text: "项目3", |
|
value: 3, |
|
}, |
|
{ |
|
text: "项目4", |
|
value: 4, |
|
} |
|
], |
|
{ |
|
type: "bi.single_select_item", |
|
height: 25, |
|
} |
|
), |
|
}, |
|
adapter, |
|
} |
|
], |
|
}); |
|
} |
|
}
|
|
|