当uniapp用scroll-view竖向滚动时,在scrollTop为0时,下拉会卡顿。 解决方法(只需要在app-plus里加上"bounce":"none",就可以了 ,{ "path" : "components/scollTest/scollTest", "style" : { "navigationBarTitleText": "测试scoll", "navigationBarTextStyle":"black", "enablePullDownRefresh": false, "...
--资源tab内容--><TaskResource:taskId='taskId'ref="treeRef":eventCode='eventCode':stageId='stageId'v-show="currentTab==='resource'"></TaskResource></scroll-view>data(){rerurn{scrollTop:0,oldScrollTop:0,}}scroll(e){this.oldScrollTop=e.detail.scrollTop;},//切换tabhandleClickSegment(...
superinsect 用官方给的例子是可以的:https://uniapp.dcloud.net.cn/component/scroll-view.html goTop: function(e) { // 解决view层不同步的问题 this.scrollTop = this.old.scrollTop this.$nextTick(function() { this.scrollTop = 0 }); uni.showToast({ icon: "none", title: "纵向滚动 scrol...
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-top不生效,但是设置高度百分之百又满足不了区域滚动,设置百分之分有时还会错位 ---好了不比比,直接上代码,建议全部复制过去 <template> <view class="content flex-column"> <view class="top-view flex-center" @tap="clickEvnet(0)"> 点击...
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....
在浏览器设置scrollTop初始值可以通过以下两种方式实现 (1)scrollTo()方法 window.scrollTo(0,0) (2)scrollTo对象 window.scrollTo({ left:0, top:0 }) 三、uniapp/微信小程序设置scrollTop初始值 在uniapp/微信小程序中,可以利用scroll-into-view属性,通过自己构造定位器,间接设置scrollTop初始值。
问题描述 H5 点击跳转出发 onPageScroll 事件,scrollTop 为 0 复现步骤 [复现问题的步骤] 滚动页面向下 点击 跳转其他页面 查看 log ,onPageScroll 事件,e.scrollTop 为 0 预期结果 e.scrollTop 应为滚动位置,或者点击跳转不触发 onPageScroll 事件,微信小程序就不触发
export default { data() { return { scrollTop: 0, // 存储当前滚动位置 }; }, methods: { getScroll(e) { this.scrollTop = e.detail.scrollTop; }, handleBlur() { // 当输入框失去焦点时,恢复到之前的滚动位置 uni.pageScrollTo({ scrollTop: this.scrollTop, }); }, }, }; </scrip...
1,指定位置为0-1的随机数,1px不容易看出来,一般场景足够,滚动到300位置可以用300 + Math.random()偏差很小,可以容忍 <scroll-view scroll-y="true" :scroll-top="scrollViewTop"> this.scrollViewTop = Math.random(); 1. 2. 3. 2,结合@scroll事件一直监听,个人认为对性能是一种损耗 ...