该组件已经不再维护,也不建议使用,大部分情况下也不需要用到该组件。
建议使用第三方相关组件,相关 issue 将不会处理。
Scroller
的内容必须是一个div
,并且只能有一个div
Scroller
希望解决的是简单的列表问题而不是一个内嵌各种复杂标签交互的容器,很容易发生性能或者交互问题。
默认高度为整个视口高度,如果你加了x-header
,那么你需要减去一个x-header
的高度: height="-46"
请确保在你的数据更新后进行`reset`操作(参考下面文档),如果你做了`reset`还有问题再开`issue`并附上代码,否则将`绝对不会被处理`。
API
Props
name | type | default | description | required version |
value | object | current pulldown and pullup status, use v-model for binding | -- | |
height | string | viewport height | scroller's height, you can use height=-40 to make scroller set to height: viewportHeight - 40px | -- |
lock-x | boolean | false | lock the horizontal direction | -- |
lock-y | boolean | false | lock the vertical direction | -- |
scrollbar-x | boolean | false | if show horizontal scrollbar | -- |
scrollbarY | boolean | false | if show vertical scrollerbar | -- |
bounce | boolean | true | if use bounce effect | -- |
use-pulldown | boolean | false | if use pulldown plugin | -- |
use-pullup | boolean | false | if use pullup plugin | -- |
pulldown-config | object | see below | config for pulldown plugin | -- |
pullup-config | object | see below | config for pullup plugin | -- |
scroll-bottom-offset | number | 0 | where to emit event:on-scroll-bottom before reaching bottom | v2.2.1-rc.6 |
Events
name | params | description | required version |
@on-scroll | (position) | emits when user scrolls | -- |
@on-scroll-bottom | -- | emits when user scrolls to bottom. The event may emit multiple times, so you should use a variable for keeping status if you need fetching data | v2.2.1-rc.6 |
@on-pulldown-loading | -- | emits when scroller is on pulldown-loading status | -- |
@on-pullup-loading | -- | emits when scroller is on pullup-loading status | -- |
Slots
name | description | required version |
default | scroller content, should has only one div root | -- |
Functions
name | params | description | required version |
reset | (position, duration, easing) | reset scroller to reset height whenever your data is changed. easing can be one of ease-in, ease-in-out, ease, bezier(n, n, n, n) | |
donePullup | set pullup done after new data is fetched | ||
disablePullup | disable pullup plugin when there is no more data | ||
enablePullup | enable pullup plugin | ||
donePulldown | set pulldown done after new data is fetched |
Contributors
Contributors
Total commits quantity: 31,Total contributors quantity: 3
airylandLinHaobinlichunqiangChangelog
Releases
- v2.6.1 [change] call `reset` in `updated` hook
- v2.2.1-rc.8 [change] set prop:prevent-default to false by default
- v2.2.1-rc.6 [feature] Support event:on-scroll-bottom
- v2.2.1-rc.6 [fix] Disable trigger click
- v2.2.1-rc.4 [feature] Support duration and easing for reset function. #1240
- v2.2.0 [fix] Fix issue when redirecting on scrolling #1187
- v2.2.0 [fix] Fix resize listener not being destroyed #1183