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) }