fix: 修正product-list的遍历问题
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
<div class="products-container">
|
||||
<el-collapse v-model="activeNames" class="product-collapse">
|
||||
<el-collapse-item
|
||||
v-for="[key, value] in groupedProducts"
|
||||
v-for="[key, value] in Object.entries(groupedProducts)"
|
||||
:key="key"
|
||||
:title="key || '未分类'"
|
||||
:name="key || 'no-category'"
|
||||
@ -64,9 +64,9 @@
|
||||
}
|
||||
groups[typeKey]?.data.push(prod);
|
||||
}
|
||||
const sortedGroups = Object.entries(groups)
|
||||
.sort(([, a], [, b]) => a.sort - b.sort)
|
||||
.map(([key, value]) => [key, value]);
|
||||
const sortedGroups = Object.fromEntries(
|
||||
Object.entries(groups).sort(([, a], [, b]) => a.sort - b.sort)
|
||||
);
|
||||
return sortedGroups;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user