Skip to content

Commit

Permalink
Feat index list options
Browse files Browse the repository at this point in the history
* feat(index-list): add "options" props

* docs(index-list): update document about props "options"

* refactor: deprecated
  • Loading branch information
tank0317 authored and dolymood committed Jun 13, 2018
1 parent 0510ba5 commit 4e57b51
Show file tree
Hide file tree
Showing 9 changed files with 2,480 additions and 2,447 deletions.
5 changes: 3 additions & 2 deletions document/components/docs/en-US/index-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@
| data | data to be displayed | Array | [] |
| navbar | whether need navbar | Boolean | true |
| speed | when click the navigator, the transition time of scrolling to the specific anchor (unit: ms). | number | 0 |
| pullUpLoad<sup>1.8.0+</sup> | pull-up-load, the detail config is same as the `options.pullUpLoad` of Scroll | Boolean/Object | false |
| pullDownRefresh<sup>1.8.0+</sup> | pull-down-refresh, the detail config is same as the `options.pullDownRefresh` of Scroll | Boolean/Object | false |
| options<sup>1.9.8+</sup> | the options of better-scroll, you could find details at [BS Document](https://ustbhuangyi.github.io/better-scroll/doc/en/options.html) | Object | {<br> observeDOM: true,<br> click: true,<br> probeType: 1,<br> scrollbar: false,<br> pullDownRefresh: false,<br> pullUpLoad: false<br>} |
| pullUpLoad<sup>1.8.0+</sup> | pull-up-load, the detail config is same as the `options.pullUpLoad` of Scroll. `Deprecated`, please use the property `options` instead. | Boolean/Object | false |
| pullDownRefresh<sup>1.8.0+</sup> | pull-down-refresh, the detail config is same as the `options.pullDownRefresh` of Scroll. `Deprecated`, please use the property `options` instead. | Boolean/Object | false |

- `data` sub configuration

Expand Down
5 changes: 3 additions & 2 deletions document/components/docs/zh-CN/index-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@
| data | 需要展示的数据 | Array | [] |
| navbar | 是否需要导航栏 | Boolean | true |
| speed | 点击导航栏索引时,滚动到相应位置的动画时间(单位:ms) | number | 0 |
| pullUpLoad<sup>1.8.0+</sup> | 上拉加载,具体配置参考 scroll 组件的 `options.pullUpLoad` | Boolean/Object | false |
| pullDownRefresh<sup>1.8.0+</sup> | 下拉刷新,具体配置参考 scroll 组件的 `options.pullDownRefresh` | Boolean/Object | false |
| options<sup>1.9.8+</sup> | better-scroll 配置项,具体请参考[BS 官方文档](https://ustbhuangyi.github.io/better-scroll/doc/zh-hans/options.html) | Object | {<br> observeDOM: true,<br> click: true,<br> probeType: 1,<br> scrollbar: false,<br> pullDownRefresh: false,<br> pullUpLoad: false<br>} |
| pullUpLoad<sup>1.8.0+</sup> | 上拉加载,具体配置参考 scroll 组件的 `options.pullUpLoad``即将废弃`,推荐使用 `options` 属性 | Boolean/Object | false |
| pullDownRefresh<sup>1.8.0+</sup> | 下拉刷新,具体配置参考 scroll 组件的 `options.pullDownRefresh``即将废弃`,推荐使用 `options` 属性 | Boolean/Object | false |

- `data` 子配置项

Expand Down
8 changes: 5 additions & 3 deletions example/pages/index-list/pull-down-refresh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ref="indexList"
:data="data"
:title="title"
:pullDownRefresh="pullDownRefresh"
:options="options"
@select="selectItem"
@title-click="clickTitle"
@pulling-down="onPullingDown">
Expand All @@ -30,8 +30,10 @@
return {
title: 'Current City: BEIJING',
data: cityData,
pullDownRefresh: {
stop: 55
options: {
pullDownRefresh: {
stop: 55
}
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions example/pages/index-list/pull-up-load.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ref="indexList"
:data="data"
:title="title"
:pullUpLoad="true"
:options="options"
@select="selectItem"
@title-click="clickTitle"
@pulling-up="onPullingUp">
Expand All @@ -29,7 +29,10 @@
data() {
return {
title: 'Current City: BEIJING',
data: cityData.slice(0, 4)
data: cityData.slice(0, 4),
options: {
pullUpLoad: true
}
}
},
methods: {
Expand Down
Loading

0 comments on commit 4e57b51

Please sign in to comment.