Selaa lähdekoodia

Merge pull request #593 from xzz2021/master

fix: 修复store里title不更新,Enter登录重复触发
Archer 2 kuukautta sitten
vanhempi
commit
3a476232ae
2 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 2 0
      src/store/modules/app.ts
  2. 1 0
      src/views/Login/components/LoginForm.vue

+ 2 - 0
src/store/modules/app.ts

@@ -328,6 +328,8 @@ export const useAppStore = defineStore('app', {
         valueLight: 'light'
       })
       isDark.value = this.getIsDark
+      const newTitle = import.meta.env.VITE_APP_TITLE
+      newTitle !== this.getTitle && this.setTitle(newTitle)
     }
   },
   persist: true

+ 1 - 0
src/views/Login/components/LoginForm.vue

@@ -76,6 +76,7 @@ const schema = reactive<FormSchema[]>([
       // 按下enter键触发登录
       onKeydown: (_e: any) => {
         if (_e.key === 'Enter') {
+          _e.stopPropagation() // 阻止事件冒泡
           signIn()
         }
       }