当前位置:网站首页>小程序:scroll-view默认滑倒最下面
小程序:scroll-view默认滑倒最下面
2022-07-28 15:44:00 【Ponnenult】
前言:
小程序在使用scroll-view的时候,默认让滚动条到最下面。
实现步骤:
1、界面 加上 scroll-top 的属性
<scroll-view
class="chat-message-box"
scroll-into-view="{
{ toview }}"
scroll-y="true"
scroll-top="{
{scrollTop}}"
bindscrolltoupper="loadMore"
>
<view class="message-box-list">
...2、data里面定义
scrollTop:0 //当前滚动条位置
3、动态改他的滚动条位置
let query = wx.createSelectorQuery().in(this)
query.select('.message-box-list').boundingClientRect(res=>{
this.setData({
scrollTop: res.height
})
})
query.exec(res=>{})
边栏推荐
- Curl returns blank or null without output. Solve the problem
- About the web docking pin printer, lodop uses
- Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment
- 使用js直传oss阿里云存储文件,解决大文件上传服务器限制
- Detailed record of steps to configure web server (many references)
- ANSYS二次开发 - MFC界面调用ADPL文件
- 排序1-插入排序与希尔排序
- Ansa secondary development - build ansa secondary development environment on Visual Studio code
- ANSA二次开发 - 抽中面的两种方法
- LeetCode-学会复杂带随机指针链表的题(详解)
猜你喜欢

学会使用MySQL的Explain执行计划,SQL性能调优从此不再困难

500million users, four years earlier than wechat... This app, which has been in operation for 15 years, will be permanently discontinued

栈的介绍与实现(详解)

Optimization of network request success rate in IM instant messaging software development

LeetCode每日一练 —— 160. 相交链表

Learn ABAQUS script programming script in an hour

在abaqus中使用PyQt设计GUI

ANSA二次开发 - 界面开发工具介绍

快速掌握 Kotlin 集合函数

Using pyqt to design gui in ABAQUS
随机推荐
Ansa secondary development - apps and ansa plug-in management
nowcode-学会删除链表中重复元素两题(详解)
LwIP development | socket | UDP
WSL+Valgrind+Clion
Qt学习第一天
Detailed record of steps to configure web server (many references)
Asp.net large file block upload breakpoint resume demo
Design direction of daily development plan
Rosen's QT journey 102 listmodel
有趣的 Kotlin 0x0A:Fun with composition
ANSA二次开发 - Visual Studio Code上搭建ANSA二次开发环境
HDU1847解题思路
Kubeedge releases white paper on cloud native edge computing threat model and security protection technology
Multiple commands produce ‘.../xxx.app/Assets.car‘问题
Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment
Use js direct OSS to store files in Alibaba cloud and solve the limitation of large file upload server
微软100题-天天做-第11题
局域网无法访问apache服务器
大地坐标系转换火星坐标系
Qt学习之安装