Scroller
Install

Install

该组件已经不再维护,也不建议使用,大部分情况下也不需要用到该组件。
建议使用第三方相关组件,相关 issue 将不会处理。

Scroller的内容必须是一个div,并且只能有一个div
Scroller 希望解决的是简单的列表问题而不是一个内嵌各种复杂标签交互的容器,很容易发生性能或者交互问题。

默认高度为整个视口高度,如果你加了x-header,那么你需要减去一个x-header的高度: height="-46"



请确保在你的数据更新后进行`reset`操作(参考下面文档),如果你做了`reset`还有问题再开`issue`并附上代码,否则将`绝对不会被处理`。

API

Props

nametypedefaultdescriptionrequired version
valueobjectcurrent pulldown and pullup status, use v-model for binding--
heightstringviewport heightscroller's height, you can use height=-40 to make scroller set to height: viewportHeight - 40px--
lock-xbooleanfalselock the horizontal direction--
lock-ybooleanfalselock the vertical direction--
scrollbar-xbooleanfalseif show horizontal scrollbar--
scrollbarYbooleanfalseif show vertical scrollerbar--
bouncebooleantrueif use bounce effect--
use-pulldownbooleanfalseif use pulldown plugin--
use-pullupbooleanfalseif use pullup plugin--
pulldown-configobjectsee belowconfig for pulldown plugin--
pullup-configobjectsee belowconfig for pullup plugin--
scroll-bottom-offsetnumber0where to emit event:on-scroll-bottom before reaching bottomv2.2.1-rc.6

Events

nameparamsdescriptionrequired 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 datav2.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

namedescriptionrequired version
defaultscroller content, should has only one div root--

Functions

nameparamsdescriptionrequired 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)
donePullupset pullup done after new data is fetched
disablePullupdisable pullup plugin when there is no more data
enablePullupenable pullup plugin
donePulldownset pulldown done after new data is fetched


Contributors

Contributors

Total commits quantity: 31,Total contributors quantity: 3

airylandLinHaobinlichunqiang

Changelog

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