Commit 5cb27319 authored by 胡笑坤's avatar 胡笑坤

排序

parent 909d8df0
......@@ -68,7 +68,7 @@
<div
class="contboxitem"
v-for="(item, index) in currentPageList"
:key="item.BrandId || index"
:key="item.brandId || index"
:class="{
'selected-item': fieldValue && item.boxBarProductLineDeviceCode === fieldValue,
'scanned-item': isScannedItem(item)
......@@ -191,7 +191,7 @@ export default {
// 分页逻辑:当前页数据
currentPageList() {
const list = this.data.childrenList || [];
const sortedList = [...list].sort((a, b) => (a.BrandId || 0) - (b.BrandId || 0));
const sortedList = [...list].sort((a, b) => (a.brandId || 0) - (b.brandId || 0));
const start = (this.currentPage - 1) * this.pageSize;
const end = start + this.pageSize;
return sortedList.slice(start, end);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment