problem, as noted below, is simply that I called another method in a method in methods, but the method I called did not successfully manipulate the value in my data. I passed the value in this data as a parameter.
data(){
return {
loadList:[]
}
},
methods: {
//loadingGet
loadingGet:function(loaddata,resdata,loadnum){
if(loaddata.length + loadnum > resdata.length){
loaddata = resdata.slice(0,resdata.length);
if(loaddata.length == resdata.length){
this.loading = false;
this.finished = true;
}else {
this.finished = false;
}
}else{
loaddata = resdata.slice(0,loaddata.length + loadnum)
this.loading = false;
console.log(loaddata)//
console.log(this.loadList)//undefined
}
},
onLoad(){
this.loading = true;
axios.get("https://XXX")
.then(res=>{
console.log(res.data);
let goods = res.data;
if(this.tabIndex == 0){
this.loadingGet(this.loadList,goods,6);//
console.log(this.loadList)//
}
});
},
},