let ind = this.limitIndex;
let size = this.limitSize;
const top = this.$refs.parentScroller.scrollTop;
if (top < 0) return;
let n = parseInt(top / 42);
let count = 0;
if (n > ind) {
let s = n - ind;
for (var i = 1; i <= s; i++) {
let num = ind + size + i - 1;
if (num > -1 && num < countries.length) {
count++;
if (countryCode.indexOf(num) < -1) continue;
console.dir(num);
this.targetCountries.push(countries[num]);
countryCode.push(num);
}
}
this.targetCountries.sort((k, m) => k.id - m.id);
this.targetCountries.splice(0, count);
this.limitIndex = n;
} else if (n < ind) {
let s = ind - n;
for (var i = 0; i < s; i++) {
let num = n + i;
console.dir(num);
if (num > -1 && num < countries.length) {
count++;
this.targetCountries.push(countries[num]);
}
}
this.targetCountries.sort((k, m) => k.id - m.id);
this.targetCountries.splice(this.targetCountries.length - count, count);
this.limitIndex = n;
}
},