From 8e9f2e0dd452b86f9ef480f80cba95ca8cd817f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 12 Oct 2024 03:03:37 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E8=8E=B7=E5=8F=96=E9=9A=A7=E9=81=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E8=8A=82=E7=82=B9=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/proxies/ConfigView.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/views/proxies/ConfigView.vue b/src/views/proxies/ConfigView.vue index 7006411..b14019a 100644 --- a/src/views/proxies/ConfigView.vue +++ b/src/views/proxies/ConfigView.vue @@ -105,8 +105,18 @@ onMounted(async () => { sendErrorMessage('请求节点列表失败: ' + e) } if (!rs) return - var i = 0 - rs.data.list.forEach((s) => { + let i = 0 + const list = rs.data.list + list.sort((a, b) => { + if (a.name < b.name) { + return -1 + } + if (a.name > b.name) { + return 1 + } + return 0 + }) + list.forEach((s) => { if (i === 0) { node.value = s.id updateValue(s.id)