In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how Mini Program pulls up and loads scroll-view components". The editor shows you the operation process through an actual case. The method of operation is simple, fast and practical. I hope this article "how to pull up and load scroll-view components on Mini Program" can help you solve the problem.
According to official documents, scroll-view is a p container with all kinds of sliding trigger events, such as scroll bar scrolling, bottom touching, and touching.
Three of these properties scroll-top: set the position of the scroll bar
, scroll-y: whether vertical sliding is allowed, height: is the height of the component
Bindscrolltolower is an event triggered by binding bottoming.
Bindscroll is the time when scrolling triggers
The event triggered by Bindscrolltoupper reaching the top is not suitable to be used as a drop-down refresh because it is triggered by touching the top.
Generally speaking, the properties of components are dynamically controlled by JS.
You can add some loading components and data that need to be traversed
What we're going to use here is the Bindscrolltolower event to implement our pull-up load.
Let's talk about how to achieve this:
First we need to set the page page number to the global variable let page
Then page++ is assigned in the bindDownLoad function.
BindDownLoad:function () {
Page++
Wx.request ({
/ / I won't go into details about what's in it. You should be able to find it in API.
Let's mainly talk about the new ones that we need to dynamically push in the successful callback of success when we successfully get the data.
Data and then setData gives us the dataList so that every time the load is completed, the new data is not destroyed and the old data is destroyed.
It is also important to note that when the data gets the last piece of data, it needs to make an if judgment or switch judgment.
})
}
This is the end of the introduction on "how Mini Program pulls up and loads scroll-view components". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.