扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
解释:可滚动视图区域,可实现横向滚动和竖向滚动。使用竖向滚动时,需要给定该组件一个固定高度,可以通过 CSS 设置 height 。

| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
scroll-x |
Boolean |
false |
否 |
允许横向滚动 |
scroll-y |
Boolean |
false |
否 |
允许纵向滚动 |
upper-threshold |
Number/String |
50 |
否 |
距顶部 / 左边多远时(单位 px),触发 scrolltoupper 事件 |
lower-threshold |
Number/String |
50 |
否 |
距底部 / 右边多远时(单位 px),触发 scrolltolower 事件 |
scroll-top |
Number/String |
否 |
设置竖向滚动条位置。要动态设置滚动条位置,用法 | |
scroll-left |
Number/String |
否 |
设置横向滚动条位置。要动态设置滚动条位置,用法 | |
scroll-into-view |
String |
否 |
值应为某子元素 id(id 不能以数字开头)。设置滚动方向后,按方向滚动到该元素,动态设置用法 | |
scroll-with-animation |
Boolean |
false |
否 |
在设置滚动条位置时使用动画过渡 |
enable-back-to-top |
Boolean |
false |
否 |
iOS 点击顶部导航栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向 |
bindscrolltoupper |
EventHandle |
否 |
滚动到顶部 / 左边,会触发 scrolltoupper 事件 | |
bindscrolltolower |
EventHandle |
否 |
滚动到底部 / 右边,会触发 scrolltolower 事件 | |
bindscroll |
EventHandle |
否 |
滚动时触发, |
跳转编辑工具
在开发者工具中打开
在 WEB IDE 中打开
扫码体验
代码示例
请使用百度APP扫码
纵向滚动 class="scroll-view"scroll-yupper-threshold="1"lower-threshold="1"scroll-top="{= scrollTop =}"scroll-into-view="{= scrollIntoView =}"scroll-with-animation="true"enable-back-to-top="true"bindscrolltoupper="upper"bindscrolltolower="lower"bindscroll="scroll">A B C 下一页 滚动 回顶部
横向滚动 class="scroll-view"scroll-xbindscrolltoupper="toLeft"bindscrolltolower="toRight"scroll-left="{= scrollLeft =}"upper-threshold="1"lower-threshold="1"bindscroll="scroll">A B C
A:使用竖向滚动时,需要给
代码示例
在开发者工具中打开
在开发者工具中打开
在 WEB IDE 中打开
纵向滚动 scroll-ystyle="height: 1.66rem;"scroll-into-view="{= toView =}"scroll-top="{= scrollTop =}">A B C 回顶部

我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流