From 851c50a5f3d4d2ce9966668ddb90a6e2ddbe404f Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Thu, 13 Feb 2025 15:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/popup/tool.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/popup/tool.vue b/src/views/popup/tool.vue index ab7f0d5..302c974 100644 --- a/src/views/popup/tool.vue +++ b/src/views/popup/tool.vue @@ -20,17 +20,21 @@ export default defineComponent({ if (data) { data.sortByName(); console.log(data); + const result: ToolItem[] = []; data.data.forEach((item) => { item.getTryInfos().forEach((info) => { - let arr = list.value.find((item) => item.type === info.type); + let arr = result.find((item) => item.type === info.type); if (!arr) { arr = new ToolItem(info.type); arr.title = data.keys[info.type] || info.type || "推荐列表"; - list.value.push(arr); + result.push(arr); } arr.items.push({ name: info.name, url: info.url, store: item.store }); }); }); + // 按照type逆序,主要是为了保证和之前的版本一致 + result.sort((a, b) => b.type.localeCompare(a.type)); + list.value = result; } }); return {