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.
1.8 KiB
1.8 KiB
bi.tab
tab面板,BI.Widget
{% method %} source
{% common %}
BI.createWidget({
element: "#wrapper",
type: "bi.tab",
tab: {
type: "bi.button_group",
height: 30,
items: [{
text: "Tab1",
value: 1,
width: 50
}, {
text: "Tab2",
value: 2,
width: 50
}]
},
cardCreator: function(v) {
switch (v) {
case 1:
return BI.createWidget({
type: "bi.label",
cls: "bi-card",
text: "面板1"
})
case 2:
return BI.createWidget({
type: "bi.label",
cls: "bi-card",
text: "面板2"
})
}
}
})
{% endmethod %}
API
基础属性
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
direction | 控件位置 | string | top,bottom,left,right,custom | "bottom" |
single | 是否为单页 | boolean | true,false | false |
showIndex | 是否默认显示tab页 | number,falser | number,false | false |
tab | tab标签页 | object | — | { } |
logic | 布局逻辑 | object | — | {dynamic:false} |
cardCreator | 面板构造器 | function | — | function (v) {return BI.createWidget();} |
对外方法
名称 | 说明 | 回调参数 |
---|---|---|
removeTab | 移除tab面板页 | tabName |
getTab | 获取tab面板页 | v |
setSelect | 设置选中的index | v |
getSelect | 获取选中的index | — |
getSelectedTab | 获取选中的tab面板页 | — |
populate | 刷新列表 | items |
setValue | 设置value值 | value |
getValue | 获取被选中的值 | — |