master
sws 2023-09-04 16:14:59 +08:00
parent 20b24ab4ee
commit 24f1ae8dfb
3 changed files with 11 additions and 11 deletions

14
App.vue
View File

@ -1842,17 +1842,17 @@
return color_obj[theme];
},
//
group_arry(array, subGroupLength) {
group_arry(arry, sub_group_length) {
let index = 0;
let newArray = [];
if (array.length > subGroupLength) {
while (index < array.length) {
newArray.push(array.slice(index, index += subGroupLength));
let new_arry = [];
if (arry.length > sub_group_length) {
while (index < arry.length) {
new_arry.push(arry.slice(index, index += sub_group_length));
}
} else {
newArray = [array];
new_arry = [arry];
}
return newArray;
return new_arry;
},
},

View File

@ -53,7 +53,7 @@
},
//
handle_data() {
this.swiperData = app.globalData.groupArry(this.propData, 10);
this.swiperData = app.globalData.group_arry(this.propData, 10);
},
swiper_change(e) {
this.current = e.detail.current

View File

@ -107,13 +107,13 @@
let swiperData = [];
if (this.hotData.length % 2 == 0) {
//
swiperData = app.globalData.groupArry(item.d, 2);
swiperData = app.globalData.group_arry(item.d, 2);
} else {
//
if (this.hotData.length === i + 1) {
swiperData = app.globalData.groupArry(item.d, 4);
swiperData = app.globalData.group_arry(item.d, 4);
} else {
swiperData = app.globalData.groupArry(item.d, 2);
swiperData = app.globalData.group_arry(item.d, 2);
}
}
item.d = swiperData