fix(mail): 邮箱选择改字符串绑定,修复切换后输入框显示未更新
This commit is contained in:
1 parent
1332f25326
commit
6454ab0bf5
1 file changed
+11
-2
@@ -75,6 +75,15 @@ const changePwdForm = ref({ OldPassword: '', NewPassword: '', ConfirmPassword: '
|
||||
const myAddress = computed(() => selectedMailbox.value?.MailboxName || '')
|
||||
const mailboxCount = computed(() => myMailboxes.value.length)
|
||||
const atMailboxLimit = computed(() => myMailboxes.value.length >= 5)
|
||||
/** 登录页邮箱选择:字符串驱动显示,避免 el-select 对象引用匹配失效 */
|
||||
const selectedName = computed({
|
||||
get: () => selectedMailbox.value?.MailboxName || '',
|
||||
set: (name: string) => {
|
||||
const hit = myMailboxes.value.find((m) => m.MailboxName === name)
|
||||
if (hit) selectedMailbox.value = hit
|
||||
loginForm.value.Password = ''
|
||||
},
|
||||
})
|
||||
|
||||
// === 本地已读覆盖 ===
|
||||
// Stalwart v0.11 存在 JMAP keywords 写入已知 bug(GitHub #1139):setSeen 返回成功但已读随机回退未读,
|
||||
@@ -726,14 +735,14 @@ function isSelected(id: string): boolean {
|
||||
</div>
|
||||
<el-select
|
||||
v-if="myMailboxes.length > 1"
|
||||
v-model="selectedMailbox"
|
||||
v-model="selectedName"
|
||||
class="login-address-select"
|
||||
placeholder="选择要登录的邮箱"
|
||||
>
|
||||
<el-option
|
||||
v-for="m in myMailboxes"
|
||||
:key="m.MailboxName"
|
||||
:value="m"
|
||||
:value="m.MailboxName"
|
||||
:label="m.MailboxName"
|
||||
:disabled="m.Status !== 1"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user