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.
77 lines
1.8 KiB
77 lines
1.8 KiB
7 years ago
|
# bi.navigation
|
||
|
|
||
|
## 导航栏控件,[BI.Widget](/core/widget.md)
|
||
|
|
||
|
{% method %}
|
||
7 years ago
|
[source](https://jsfiddle.net/fineui/ubsren48/)
|
||
7 years ago
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
7 years ago
|
|
||
7 years ago
|
BI.createWidget({
|
||
7 years ago
|
element: "#wrapper",
|
||
7 years ago
|
type: "bi.navigation",
|
||
|
tab: {
|
||
7 years ago
|
height: 30,
|
||
|
items: [{
|
||
|
once: false,
|
||
|
text: "后退",
|
||
|
value: -1
|
||
|
}, {
|
||
|
once: false,
|
||
|
text: "前进",
|
||
|
value: 1
|
||
|
}]
|
||
7 years ago
|
},
|
||
7 years ago
|
cardCreator: function(v) {
|
||
|
return BI.createWidget({
|
||
|
type: "bi.label",
|
||
|
cls: "layout-bg" + BI.random(1, 8),
|
||
|
text: "第" + v + "页"
|
||
|
})
|
||
|
}
|
||
7 years ago
|
})
|
||
|
|
||
|
|
||
|
|
||
7 years ago
|
|
||
7 years ago
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
|
| direction | 控件位置 | string | top,bottom,left,right,custom | "bottom"|
|
||
7 years ago
|
| single | 是否为单页 | boolean | true,false | true |
|
||
|
| defaultShowIndex | 是否默认显示 |boolean | true,false | true |
|
||
|
| tab | tab页元素 | boolean | true,false | true |
|
||
7 years ago
|
| logic | 布局逻辑 | object | — | {dynamic:true} |
|
||
7 years ago
|
| cardCreator | 面板构造器 | function | — | v |
|
||
|
| afterCardCreated | 面板构造之后 | function | — | — |
|
||
7 years ago
|
| afterCardShow | 面板显示之后 | function | —| — |
|
||
7 years ago
|
|
||
|
|
||
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| render | 渲染组件 | — |
|
||
|
| mounted | 挂载组件 | —|
|
||
7 years ago
|
| afterCardCreated | 创建卡导航页页之后 | v |
|
||
|
| afterCardShow | 导航页展示之后 | v |
|
||
7 years ago
|
| setSelect | 设置选中的index | v |
|
||
|
| getSelect | 获取选中的index| —|
|
||
7 years ago
|
| getSelectedCard | 获取选中的导航页| —|
|
||
7 years ago
|
| populate | 刷新列表 | items |
|
||
|
| setValue | 设置value值 | value |
|
||
|
| getValue | 获取被选中的值 |—|
|
||
|
|
||
|
|
||
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|