fix: Mp/WxAccountSelect name字段更新

(cherry picked from commit 82dc0054f2)
This commit is contained in:
dhb52 2023-04-17 16:21:41 +08:00 committed by shizhong
parent ec834f2893
commit 732f65e22c

View File

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