mirror of
https://github.com/certd/certd.git
synced 2026-07-06 03:47:34 +08:00
fix(login): 修复输入法 composing 状态下回车触发提交的问题
优化登录页面的回车提交逻辑,避免中文输入法输入过程中按回车误触发表单提交
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user