hookehuyr

移动端产品优势只有一条数据时,显示优化

<!--
* @Date: 2024-09-29 14:26:41
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-05 10:15:08
* @LastEditTime: 2024-11-05 10:27:39
* @FilePath: /hager/src/views/product/detail.vue
* @Description: 文件描述
-->
......@@ -362,6 +362,9 @@ export default {
return result;
},
splitIntoEqualChunks(list) {
if (this.is_xs && list.length === 1) { // 移动端只有一个元素,直接返回一个包含该元素的数组
return [list]
}
const middle = Math.ceil(list.length / 2); // 计算数组的一半,向上取整
const result = [];
......