style(Login): update login styles
This commit is contained in:
parent
1436543a5c
commit
eb68f1d919
16
src/App.vue
16
src/App.vue
|
@ -1,17 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { useLocaleStore } from '@/store/modules/locale'
|
|
||||||
import { ElConfigProvider } from 'element-plus'
|
|
||||||
import { ConfigGlobal } from '@/components/ConfigGlobal'
|
import { ConfigGlobal } from '@/components/ConfigGlobal'
|
||||||
import { isDark } from '@/utils/is'
|
import { isDark } from '@/utils/is'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const localeStore = useLocaleStore()
|
|
||||||
|
|
||||||
const locale = computed(() => localeStore.locale)
|
|
||||||
|
|
||||||
const size = computed(() => appStore.size)
|
const size = computed(() => appStore.size)
|
||||||
|
|
||||||
function initDark() {
|
function initDark() {
|
||||||
|
@ -24,15 +18,7 @@ initDark()
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ConfigGlobal :size="size">
|
<ConfigGlobal :size="size">
|
||||||
<ElConfigProvider
|
<RouterView />
|
||||||
:locale="locale.elLocale"
|
|
||||||
:size="size"
|
|
||||||
:button="{
|
|
||||||
autoInsertSpace: true
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<RouterView />
|
|
||||||
</ElConfigProvider>
|
|
||||||
</ConfigGlobal>
|
</ConfigGlobal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,22 @@
|
||||||
<script lang="tsx">
|
<script setup lang="ts">
|
||||||
import { provide, defineComponent } from 'vue'
|
import { provide, computed } from 'vue'
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
import { ElConfigProvider } from 'element-plus'
|
||||||
|
import { useLocaleStore } from '@/store/modules/locale'
|
||||||
|
|
||||||
export default defineComponent({
|
const localeStore = useLocaleStore()
|
||||||
name: 'ConfigGlobal',
|
|
||||||
inheritAttrs: false,
|
|
||||||
props: {
|
|
||||||
size: propTypes.oneOf(['default', 'medium', 'small', 'mini']).def('default')
|
|
||||||
},
|
|
||||||
setup(props, { slots }) {
|
|
||||||
provide('configGlobal', props)
|
|
||||||
|
|
||||||
return () => slots.default?.()
|
const locale = computed(() => localeStore.locale)
|
||||||
}
|
|
||||||
|
const props = defineProps({
|
||||||
|
size: propTypes.oneOf<ElememtPlusSzie[]>(['default', 'small', 'large']).def('default')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
provide('configGlobal', props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ElConfigProvider :locale="locale.elLocale" :size="size">
|
||||||
|
<slot></slot>
|
||||||
|
</ElConfigProvider>
|
||||||
|
</template>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { i18n } from '@/plugins/i18n'
|
import { i18n } from '@/plugins/vueI18n'
|
||||||
|
|
||||||
type I18nGlobalTranslation = {
|
type I18nGlobalTranslation = {
|
||||||
(key: string): string
|
(key: string): string
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { i18n } from '@/plugins/i18n'
|
import { i18n } from '@/plugins/vueI18n'
|
||||||
import { useLocaleStoreWithOut } from '@/store/modules/locale'
|
import { useLocaleStoreWithOut } from '@/store/modules/locale'
|
||||||
import { setHtmlPageLang } from '@/plugins/i18n/helper'
|
import { setHtmlPageLang } from '@/plugins/vueI18n/helper'
|
||||||
|
|
||||||
function setI18nLanguage(locale: LocaleType) {
|
function setI18nLanguage(locale: LocaleType) {
|
||||||
const localeStore = useLocaleStoreWithOut()
|
const localeStore = useLocaleStoreWithOut()
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// 引入windi css
|
// 引入windi css
|
||||||
import '@/plugins/windicss'
|
import '@/plugins/windi.css'
|
||||||
|
|
||||||
// 导入全局的svg图标
|
// 导入全局的svg图标
|
||||||
import '@/plugins/svgIcon'
|
import '@/plugins/svgIcon'
|
||||||
|
|
||||||
// 初始化多语言
|
// 初始化多语言
|
||||||
import { setupI18n } from '@/plugins/i18n'
|
import { setupI18n } from '@/plugins/vueI18n'
|
||||||
|
|
||||||
// 引入状态管理
|
// 引入状态管理
|
||||||
import { setupStore } from '@/store'
|
import { setupStore } from '@/store'
|
||||||
|
@ -20,7 +20,7 @@ import { setupElementPlus } from '@/plugins/elementPlus'
|
||||||
import '@/styles/index.less'
|
import '@/styles/index.less'
|
||||||
|
|
||||||
// 引入动画
|
// 引入动画
|
||||||
import '@/plugins/animate'
|
import '@/plugins/animate.css'
|
||||||
|
|
||||||
// 路由
|
// 路由
|
||||||
import { setupRouter } from './router'
|
import { setupRouter } from './router'
|
||||||
|
|
|
@ -17,7 +17,10 @@ const prefixCls = getPrefixCls('login')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="prefixCls" class="h-[100%] relative overflow-hidden <xl:bg-v-dark <sm:px-10px">
|
<div
|
||||||
|
:class="prefixCls"
|
||||||
|
class="h-[100%] relative overflow-hidden <xl:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"
|
||||||
|
>
|
||||||
<div class="relative h-full flex mx-auto">
|
<div class="relative h-full flex mx-auto">
|
||||||
<div
|
<div
|
||||||
:class="`${prefixCls}__left`"
|
:class="`${prefixCls}__left`"
|
||||||
|
@ -55,9 +58,9 @@ const prefixCls = getPrefixCls('login')
|
||||||
</div>
|
</div>
|
||||||
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
||||||
<div
|
<div
|
||||||
class="h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md: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 <xl:(bg-white rounded-3xl)" />
|
<LoginForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,6 +13,12 @@ const rules = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const schema = reactive<FormSchema[]>([
|
const schema = reactive<FormSchema[]>([
|
||||||
|
{
|
||||||
|
field: 'title',
|
||||||
|
colProps: {
|
||||||
|
span: 24
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'username',
|
field: 'username',
|
||||||
label: t('login.username'),
|
label: t('login.username'),
|
||||||
|
@ -69,6 +75,10 @@ const remember = ref(false)
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Form :schema="schema" :rules="rules" label-position="top" hide-required-asterisk size="large">
|
<Form :schema="schema" :rules="rules" label-position="top" hide-required-asterisk size="large">
|
||||||
|
<template #title>
|
||||||
|
<h2 class="text-2xl font-bold text-center w-[100%]">{{ t('login.login') }}</h2>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #tool>
|
<template #tool>
|
||||||
<div class="flex justify-between items-center w-[100%]">
|
<div class="flex justify-between items-center w-[100%]">
|
||||||
<ElCheckbox v-model="remember" :label="t('login.remember')" size="small" />
|
<ElCheckbox v-model="remember" :label="t('login.remember')" size="small" />
|
||||||
|
|
Loading…
Reference in New Issue