From fd37d9b31ee5e9d00ef97c31e027e259f5c2ad27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com> Date: Thu, 28 Apr 2022 17:52:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=86=E7=B1=BB=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sales/category/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/sales/category/index.vue b/src/views/sales/category/index.vue index 4d8ea92..aad55a8 100644 --- a/src/views/sales/category/index.vue +++ b/src/views/sales/category/index.vue @@ -90,13 +90,13 @@ rows.map((item) => item.id) ); }; - const handleSort = async (newSort, oldSort, e, list) => { - list = list || unref(list); + const handleSort = async (newSort, oldSort, e, arr) => { + arr = arr || unref(list); let direction = (oldSort - newSort) / Math.abs(oldSort - newSort); - let currentSort = list[newSort].sort; - oldSort = list[newSort + direction].sort; + let currentSort = arr[newSort].sort; + oldSort = arr[newSort + direction].sort; loading.value = true; - await store.dispatch('category/sort', { id: list[newSort].id, currentSort, oldSort }); + await store.dispatch('category/sort', { id: arr[newSort].id, currentSort, oldSort }); loading.value = false; }; const handleExpand = (row) => {