|
@@ -1,11 +1,12 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { LoginForm } from './components'
|
|
|
|
|
|
+import { LoginForm, RegisterForm } from './components'
|
|
import { ThemeSwitch } from '@/components/ThemeSwitch'
|
|
import { ThemeSwitch } from '@/components/ThemeSwitch'
|
|
import { LocaleDropdown } from '@/components/LocaleDropdown'
|
|
import { LocaleDropdown } from '@/components/LocaleDropdown'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { underlineToHump } from '@/utils'
|
|
import { underlineToHump } from '@/utils'
|
|
import { useAppStore } from '@/store/modules/app'
|
|
import { useAppStore } from '@/store/modules/app'
|
|
import { useDesign } from '@/hooks/web/useDesign'
|
|
import { useDesign } from '@/hooks/web/useDesign'
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
|
const { getPrefixCls } = useDesign()
|
|
const { getPrefixCls } = useDesign()
|
|
|
|
|
|
@@ -14,6 +15,16 @@ const prefixCls = getPrefixCls('login')
|
|
const appStore = useAppStore()
|
|
const appStore = useAppStore()
|
|
|
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
|
|
+
|
|
|
|
+const isLogin = ref(true)
|
|
|
|
+
|
|
|
|
+const toRegister = () => {
|
|
|
|
+ isLogin.value = false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const toLogin = () => {
|
|
|
|
+ isLogin.value = true
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -59,7 +70,16 @@ const { t } = useI18n()
|
|
<div
|
|
<div
|
|
class="h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px"
|
|
class="h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px"
|
|
>
|
|
>
|
|
- <LoginForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
|
|
|
|
|
+ <LoginForm
|
|
|
|
+ v-if="isLogin"
|
|
|
|
+ class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)"
|
|
|
|
+ @to-register="toRegister"
|
|
|
|
+ />
|
|
|
|
+ <RegisterForm
|
|
|
|
+ v-else
|
|
|
|
+ class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)"
|
|
|
|
+ @to-login="toLogin"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</Transition>
|
|
</Transition>
|
|
</div>
|
|
</div>
|