Back to Taro

taro-scroll-view-core

packages/taro-components/src/components/scroll-view/readme.md

4.2.04.4 KB
Original Source

taro-scroll-view-core

API

属性类型默认值说明
scroll-xBooleanfalse允许横向滚动
scroll-yBooleanfalse允许纵向滚动
upper-thresholdNumber50距顶部/左边多远时(单位 px),触发 scrolltoupper 事件
lower-thresholdNumber50距底部/右边多远时(单位 px),触发 scrolltolower 事件
scroll-topNumber设置竖向滚动条位置
scroll-leftNumber设置横向滚动条位置
scroll-into-viewString值应为某子元素 id(id 不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素
scroll-with-animationBooleanfalse在设置滚动条位置时使用动画过渡
enable-back-to-topBooleanfalseiOS 点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向
bindscrolltoupperEventHandle滚动到顶部/左边,会触发 scrolltoupper 事件
bindscrolltolowerEventHandle滚动到底部/右边,会触发 scrolltolower 事件
√(onScroll)bindscrollEventHandle是否解码
<!-- Auto Generated Below -->

Properties

PropertyAttributeDescriptionTypeDefault
animatedscroll-with-animationbooleanfalse
lowerThresholdlower-thresholdnumber | string50
mpScrollIntoViewscroll-into-viewstringundefined
mpScrollIntoViewAlignmentscroll-into-view-alignment"center" | "end" | "nearest" | "start"undefined
mpScrollLeftscroll-leftnumber | stringundefined
mpScrollTopscroll-topnumber | stringundefined
scrollXscroll-xbooleanfalse
scrollYscroll-ybooleanfalse
upperThresholdupper-thresholdnumber | string50

Events

EventDescriptionType
scrollCustomEvent<any>
scrolltolowerCustomEvent<any>
scrolltoupperCustomEvent<any>

Methods

mpScrollIntoViewMethod(selector: string) => Promise<void>

Returns

Type: Promise<void>

mpScrollToMethod(object: ScrollViewContext.scrollTo.Option) => Promise<void>

Returns

Type: Promise<void>


Built with StencilJS