data: {// data内不需要设置scrollTop},// 将scrollTop放在一个事件内执行,切换页面重置滚动条navTabClick() {this.setData({scrollTop:0}) }, 注意: 这种在data内直接设置scrollTop初始化是无法生效的 <scroll-viewclass="listDetail"scroll-y="true" bindscrolltolower="scrollLower"scroll-top="{{scrollT...
关键是设置scroll事件及赋值时要是延迟的,放在$nextTick或setTimeout <scroll-viewclass="scroll_content"scroll-y="true":scrollTop='scrollTop'@scroll='scroll':style="{'top': listTop+'px',height:taskStatus===1?scrollHeight+'px':scrollHeight2+'px'}"><!--任务tab内容--><TaskInfo:taskInfos='...
1.scroll-view的高度需要设置固定的值,比如全屏可以设置:height:100vh; 2.不可以同时设置scroll-into-view和scroll-top(scroll-left)属性,因为scroll-into-view的优先级别比scroll-top(scroll-left)属性高(官方文档提及过); 3.scroll-top(scroll-left)属性不可以带单位,直接设置值就可以了,如:scroll-top="50";...
<view> <!-- scroll-with-animation="true" 这句话也尽量给加上 --> <scroll-view scroll-y="true" class="msg-list" :style="{ height: clientHeight + 'px' }" scroll-with-animation="true" :scroll-top="scrollTopVal" @scroll="viewScroll"> <view v-for="msg in msgList.data" :key="m...
1.上下滚动因为高度的问题,scrollView没有填满所剩下的空间,没有实现区域滚动 scroll-top 不生效的问题 ,比如想滚动到底部在用这个标签之前,很多地方需要阅读官方文档比如这句话 :用竖向滚动时,需要给 一个固定高度,通过 css 设置 height。我的第二个问题就是因为没
</view> <view class="empty-tips" wx:if="{{!activeGoodsList.length}}">暂无商品</view> </scroll-view> 如图,设置scroll-view的scroll-top时,contScrollTop 需要交替的设置为不同的值才有效,比如让滚动条回到顶部,就要交替的设置值为1|0 收藏 分享 3 个评论 素还真 2018-07-19 如果原本是0,然后你...
在实际运用过程中,发现设置了scroll-top无效,滚动条位置并没有发生变化,是因为微信小程序的官方框架处于性能考虑,初始化设置scroll-top不会重新渲染页面,需要将scroll-top的是放在一个事件内执行才可以生效。 这里演示一个切换选项重置滚动条事件的案例: <scroll-view class="listDetail"scroll-y="true"bindscrollto...
<view id="blue" class="scroll-view-item bc_blue"></view> </scroll-view> 像官方case里面,设置了scrollTop,好像没看到效果 Page({ data: { scrollTop:100, toView: 'green' }) 在应用里面用到了scrolltop发现无效,跑官方case设了下,发现也这样的?
scrollTopVal: 900, msgList: {data: []} } } getList(refresh) { const _this = this;let activeTab = this.msgList;if (activeTab.isLoading) { return;} if (refresh) { activeTab.nextStart = 0;} activeTab.isLoading = true;httpUtils.requestWithGet({ url: 'xxx',data...
[问题简单描述] 使用scroll-view时,如果动态绑定scroll-top,那么scroll-into-view会无效,无法实现跳转到相应元素位置 问题复现步骤: [第一步] 当scroll-top设置为动态绑定时,无法跳转,Wxml中scroll-into-view显示已被更改 <template>