Code Format

This commit is contained in:
GitHub Actions Bot 2024-06-14 14:56:05 +00:00
parent 4479b202f6
commit 03c536bd6c
28 changed files with 438 additions and 633 deletions

View file

@ -294,22 +294,19 @@ const loadCarsLazy = (event) => {
}
//simulate remote connection with a timeout
this.loadLazyTimeout = setTimeout(
() => {
let _virtualCars = [...this.virtualCars];
let { first, last } = event;
this.loadLazyTimeout = setTimeout(() => {
let _virtualCars = [...this.virtualCars];
let { first, last } = event;
//load data of required page
const loadedCars = this.cars.slice(first, last);
//load data of required page
const loadedCars = this.cars.slice(first, last);
//populate page of virtual cars
Array.prototype.splice.apply(_virtualCars, [...[first, last - first], ...loadedCars]);
//populate page of virtual cars
Array.prototype.splice.apply(_virtualCars, [...[first, last - first], ...loadedCars]);
this.virtualCars = _virtualCars;
this.lazyLoading = false;
},
Math.random() * 1000 + 250
);
this.virtualCars = _virtualCars;
this.lazyLoading = false;
}, Math.random() * 1000 + 250);
}
}
};