v-show= "maindata.length > 0" style= "Display:none" >
<div class= "Main-common-div" >
<div class= "Common-part-div div-part-3" >
Credit to the borrower.
</div>
<div class= "Common-part-div div-part-7" >
Business Number
</div>
</div>
</div>
<div v-infinite-scroll= "Loadmore"
infinite-scroll-disabled= "Loading"
infinite-scroll-immediate-check= "false"
infinite-scroll-distance= "5" >
<div class= "Common-div" v-for= "item in Maindata" >
<div class= "main-common-div" @click = "Gourl (item)" >
<div class= "Common-part-div div-part-3" >
{{Item.truename}}
</div>
<div class= "Common-part-div div-part-7" >
{{ITEM.CREDITSN}}
</div>
</div>
</div>
</div>
v-show= "typeof (Maindata) = = ' object ' && maindata.length = = 0" style= "display:none" ></ Loadingnot>
Data () {
return {
Maindata: ", //Data storage Place
}
}
This way, when the definition data is "at the beginning, it will not show that when the Loadingnot,ajax gets the data , the Maindata cannot use the push method if it is a drop-down refresh.
Then you need to use the extension operator ...
this. $ajax ({
URL: "/api/app/credit/page?type=17",
Data: {
Current:this.current,
Size:this.size
},
Loading:2
}, res = = {
if (Res.code = = 1) {
This.maindata = [... this.maindata, ... res.records];
this.current++;
This.loading = false;
if (This.size * (this.current-1) > This.total) {
This.isend = true;
this. $alert ("All Data Loaded");
}
This.total = Res.total;
}
});
For example [... ',... [123]] [123] This will make it possible to successfully move the following data similar to the push method.
... The actual project usage of the extension operator