From 82dc0054f2ed4c7d0c5abf55e8e4d91237c79bcc Mon Sep 17 00:00:00 2001 From: dhb52 Date: Mon, 17 Apr 2023 16:21:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Mp/WxAccountSelect=20name=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mp/components/wx-account-select/main.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/mp/components/wx-account-select/main.vue b/src/views/mp/components/wx-account-select/main.vue index 110fc8a5..5359b366 100644 --- a/src/views/mp/components/wx-account-select/main.vue +++ b/src/views/mp/components/wx-account-select/main.vue @@ -22,11 +22,14 @@ const handleQuery = async () => { // 默认选中第一个 if (accountList.value.length > 0) { account.id = accountList.value[0].id + account.name = accountList.value[0].name emit('change', account.id, account.name) } } -const onChanged = () => { +const onChanged = (id?: number) => { + const found = accountList.value.find((v) => v.id === id) + account.name = found ? found.name : '' emit('change', account.id, account.name) }