Skip to content

Commit 3a47623

Browse files
Merge pull request #593 from xzz2021/master
fix: 修复store里title不更新,Enter登录重复触发
2 parents 2a9388d + 97e7660 commit 3a47623

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/store/modules/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ export const useAppStore = defineStore('app', {
328328
valueLight: 'light'
329329
})
330330
isDark.value = this.getIsDark
331+
const newTitle = import.meta.env.VITE_APP_TITLE
332+
newTitle !== this.getTitle && this.setTitle(newTitle)
331333
}
332334
},
333335
persist: true

src/views/Login/components/LoginForm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const schema = reactive<FormSchema[]>([
7676
// 按下enter键触发登录
7777
onKeydown: (_e: any) => {
7878
if (_e.key === 'Enter') {
79+
_e.stopPropagation() // 阻止事件冒泡
7980
signIn()
8081
}
8182
}

0 commit comments

Comments
 (0)