解释:可滚动视图区域,可实现横向滚动和竖向滚动。使用竖向滚动时,需要给定该组件一个固定高度,可以通过 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 回顶部 
                分享题目:创新互联百度小程序教程:scroll-view可滚动视图区域
                
                链接URL:http://www.csdahua.cn/qtweb/news3/465553.html
            
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网