fix: 默认选中第一项租户

This commit is contained in:
dap 2024-09-04 09:39:33 +08:00
parent fb525669b5
commit 049da9ea69

View File

@ -108,12 +108,15 @@ watch(
/** /**
* 默认选中第一项租户 * 默认选中第一项租户
*/ */
const stop = watch(props.tenantOptions, (options) => { const stop = watch(
if (options.length > 0) { () => props.tenantOptions,
formState.tenantId = options[0]!.tenantId; (options) => {
stop(); if (options.length > 0) {
} formState.tenantId = options[0]!.tenantId;
}); stop();
}
},
);
const usernameStatus = computed(() => { const usernameStatus = computed(() => {
return formState.submitted && !formState.username ? 'error' : 'default'; return formState.submitted && !formState.username ? 'error' : 'default';