fix(login): 修复输入法 composing 状态下回车触发提交的问题

优化登录页面的回车提交逻辑,避免中文输入法输入过程中按回车误触发表单提交
This commit is contained in:
xiaojunnuo
2026-07-05 21:37:09 +08:00
parent a8adbda04a
commit b74db81304
@@ -73,6 +73,14 @@ async function handleSubmit() {
}
}
function handleKeydownEnter(e: KeyboardEvent) {
if (e.isComposing) {
return;
}
e.preventDefault();
handleSubmit();
}
function handleGo(path: string) {
router.push(path);
}
@@ -89,7 +97,7 @@ defineExpose({
</script>
<template>
<div @keydown.enter.prevent="handleSubmit">
<div @keydown.enter="handleKeydownEnter">
<slot name="title">
<Title>
<slot name="title">