no message
This commit is contained in:
@@ -485,7 +485,7 @@ export default {
|
||||
});
|
||||
},
|
||||
onBlur() {
|
||||
this.loadData();
|
||||
this.loadData(1);
|
||||
},
|
||||
searchFun(val) {
|
||||
console.log("searchFun", val);
|
||||
@@ -532,10 +532,14 @@ export default {
|
||||
return resultM;
|
||||
},
|
||||
// 加载数据的方法
|
||||
async loadData() {
|
||||
console.log("加载数据的方法");
|
||||
async loadData(type = null) {
|
||||
console.log("加载数据的方法",type);
|
||||
if (this.loading) return; // 如果正在加载,则不重复加载
|
||||
this.loading = true; // 设置加载状态为true
|
||||
if(type){
|
||||
this.form.page = 1;
|
||||
this.orderList = [];
|
||||
}
|
||||
try {
|
||||
// 模拟异步获取数据,实际应用中应该替换为你的数据获取逻辑,例如API调用
|
||||
const newData = await this.fetchData(
|
||||
@@ -544,7 +548,7 @@ export default {
|
||||
);
|
||||
if (newData.entitys && newData.entitys.length !== 0) {
|
||||
this.orderList = [...this.orderList, ...newData.entitys]; // 将新数据添加到列表中
|
||||
this.form.page++; // 页码加1
|
||||
this.form.page++; // 页码加1
|
||||
console.log("this.orderList", this.orderList);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user