


mint-ui loadmore pull-up loading and pull-down refresh conflict handling method
This time I will bring you the conflict handling method between mint-ui loadmore pull-up loading and pull-down refresh. What are the precautions for handling the conflict between mint-ui loadmore pull-up loading and pull-down refresh? The following is a practical case, let’s take a look.
Problems encountered:
This page is a dual-tab linkage. All four parts require pull-up loading and pull-down refresh functions. The loadmore plug-in of mint-ui is used. After adding pull-up loading respectively, only the last one has this.$refs. loadmore.onTopLoaded();
andthis.$refs.loadmore.on<a href="http://www.php.cn/wiki/906.html" target="_blank">Bottom</a>Loaded();
Valid, the other three are invalid. These two sentences mean that query needs to be called once for relocation
Analysis of the reason:
First of all, these four modules are used
<mt-loadmore :top-method="loadTop" :bottom-method="loadBottom" :bottom-all-loaded="allLoaded" ref="loadmore"> <ul class="ul-box"> <li class="list-cell ta-line" v-for="(item,index) in gridNoPayMail" :key="item+'walletdetail1'" @click="choose(index)"> <p class="checkboxOne"> <input type="checkbox" name="checkInput" :id="'id1' + index" v-model="item.checked" disabled/> <label :for="'id1' + index"></label> </p> <p class="left-text"> <p class="award">{{item.a}}</p> <p class="time">{{item.b}}</p> </p> <p class="right-text"> <p class="addinfo">¥{{item.c}}</p> </p> </li> </ul> </mt-loadmore>
top-method, bottom-method, and bottom-all-loaded are given different event names respectively. The first two events represent pull-down and pull-up respectively. If the third one is true, bottomMethod will not be loaded again. Triggered, generally when entering the page we default to false
When calling the interface , the judgment of canceling the loading is made after the success. Here you can give the interface method a type value. If the type is top1, it proves that the ongoing pull-down refresh execution this.$refs.loadmore1 .onTopLoaded();
, the same applies to pull-up loading, and the other three modules
if(type=='top1'){ this.$refs.loadmore1.onTopLoaded(); }else if(type=='bottom1'){ this.$refs.loadmore1.onBottomLoaded(); }
When you get here, the problem described at the beginning will appear,
Solution
I made a lot of attempts at the beginning, such as using v-if to hide the other three modules when one module is displayed, but different problems always occurred. Later, the parameters after ref in ref="loadmore" were used in four modules. For example, the distinction is loadmore1, loadmore2..., here is how I understand it, ref The function here is to specify an index ID for the subcomponent, which is similar to the id of the dom element. The id name cannot be the same, so we change the ref to a different parameter and the problem is solved,
Attached is the Vue official website linkhttps://vuejs.org/
mint-ui:https://mint-ui.github.io/docs/#/en2/loadmore
PS: Mint-ui loadmore component attention issues
loadTop(){ this.$store.dispatch('getNewsList',{channelId:this.id,page:0,size:this.size}); this.$refs.loadmore.onTopLoaded(); },
For example, when doing pull-down refresh, remember to add
this.$refs.loadmore.onTopLoaded();
in the pull-down refresh function. This line of code, otherwise the loading will always be displayed after the drop-down loading, and the loading will not be completed.
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
The above is the detailed content of mint-ui loadmore pull-up loading and pull-down refresh conflict handling method. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

When you browse the web on your iPhone, the loaded content is temporarily stored as long as the browser app remains open. However, the website updates content regularly, so refreshing the page is an effective way to clear out old data and see the latest published content. This way, you always have the latest information and experiences. If you want to refresh the page on iPhone, the following post will explain you all the methods. How to Refresh Web Pages on Safari [4 Methods] There are several methods to refresh the pages you are viewing on the Safari App on iPhone. Method 1: Use the Refresh Button The easiest way to refresh a page you have open on Safari is to use the Refresh option on your browser's tab bar. If Safa

Is the F5 key not working properly on your Windows 11/10 PC? The F5 key is typically used to refresh the desktop or explorer or reload a web page. However, some of our readers have reported that the F5 key is refreshing their computers and not working properly. How to enable F5 refresh in Windows 11? To refresh your Windows PC, just press the F5 key. On some laptops or desktops, you may need to press the Fn+F5 key combination to complete the refresh operation. Why doesn't F5 refresh work? If pressing the F5 key fails to refresh your computer or you are experiencing issues on Windows 11/10, it may be due to the function keys being locked. Other potential causes include the keyboard or F5 key

Page refresh is very common in our daily network use. When we visit a web page, we sometimes encounter some problems, such as the web page not loading or displaying abnormally, etc. At this time, we usually choose to refresh the page to solve the problem, so how to refresh the page quickly? Let’s discuss the shortcut keys for page refresh. The page refresh shortcut key is a method to quickly refresh the current web page through keyboard operations. In different operating systems and browsers, the shortcut keys for page refresh may be different. Below we use the common W

The solution to the value disappearing after the react page is refreshed: 1. Refresh the page and check whether the data in the state will be cleared; 2. Use the "const name = location.query.name; const id = location.query.id;" method By adding parameters to the jump link, you can pass the parameters and refresh the page without losing the data.

What is the keyboard refresh shortcut key? With the development of computer technology, the keyboard has become an indispensable device in our daily work and life. The function of the keyboard goes far beyond entering text. It is also often used to operate various functions of the computer and improve our work efficiency. The keyboard shortcuts allow us to complete various operations more quickly and conveniently. In the daily use of computers, we often encounter situations where we need to refresh the page. When we open a web page or run software, sometimes the page will freeze or fail to load. At this time, refresh the page.

How to use routing to implement page refresh and cache control in a Vue project? In Vue project development, it is a very common requirement to use routing to implement page refresh and cache control. This article will introduce how to use routing to implement page refresh and cache control in Vue projects, and give corresponding code examples. Routing configuration First, you need to use vue-router for routing configuration in the Vue project. vue-router can be installed through npm and introduced and configured in main.js. impor

Refreshing is an operation we often perform when using computers. Refreshing can quickly display our settings for interface, display, icons and other properties. However, many friends find that there is no refresh in the right-click menu when using win11. In fact, this is because win11 A menu has been added, which needs to be entered before it can be refreshed. How to right-click refresh in win11 1. In win11 system, the right-click menu has been changed, and we will not be able to find refresh when we right-click on a blank space. 2. Instead, we need to find "showmoreoptions" at the bottom of the right-click menu. 3. After entering "showmoreoptions", you can find refresh. 4. In addition, we actually don’t need to use right-click to refresh

Recently, when some users were using the Win10 system, they found that sometimes the desktop would be automatically refreshed without stopping, and it would also refresh while we were watching videos and listening to music, which greatly affected the user experience. So What to do when the computer is turned on and the wireless network is refreshed? The editor below will tell you how to deal with the infinite refresh of the Win10 desktop when it is turned on. What should I do if the computer is turned on and the wireless network is refreshed? 1. After we enter the desktop, click the menu bar icon with the mouse. 2. Select [Resource Manager] in the opened interface. 3. After entering the page, click [Windows Task Manager] and select [End Task]. 4. After proceeding, return to the desktop and right-click the mouse to select the menu bar. 5. At this time, everyone clicks [luck]
