refactor: refacotr preference

This commit is contained in:
vben
2024-06-01 23:15:29 +08:00
parent f7b97e8a83
commit fed47f5e05
139 changed files with 2205 additions and 1450 deletions

View File

@@ -1,6 +1,8 @@
<script setup lang="ts">
import { preferences, usePreferences } from '@vben-core/preferences';
import { $t } from '@vben/locales';
import { preference, usePreference } from '@vben/preference';
import { computed } from 'vue';
import AuthenticationFromView from './from-view.vue';
import SloganIcon from './icons/slogan.vue';
@@ -10,7 +12,8 @@ defineOptions({
name: 'Authentication',
});
const { authPanelCenter, authPanelLeft, authPanelRight } = usePreference();
const { authPanelCenter, authPanelLeft, authPanelRight } = usePreferences();
const appName = computed(() => preferences.app.name);
</script>
<template>
@@ -33,13 +36,13 @@ const { authPanelCenter, authPanelLeft, authPanelRight } = usePreference();
"
>
<img
:alt="preference.appName"
:src="preference.logo"
:alt="appName"
:src="preferences.logo.source"
:width="42"
class="mr-2"
/>
<p class="text-xl font-medium">
{{ preference.appName }}
{{ appName }}
</p>
</div>
</div>
@@ -48,10 +51,7 @@ const { authPanelCenter, authPanelLeft, authPanelRight } = usePreference();
class="absolute inset-0 h-full w-full bg-[var(--color-authentication)]"
>
<div class="flex-col-center mr-20 h-full">
<SloganIcon
:alt="preference.appName"
class="animate-float h-64 w-2/5"
/>
<SloganIcon :alt="appName" class="animate-float h-64 w-2/5" />
<div class="text-1xl mt-6 font-sans text-white lg:text-2xl">
{{ $t('authentication.layout-title') }}
</div>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { preference } from '@vben/preference';
import { preferences } from '@vben-core/preferences';
import Toolbar from './toolbar.vue';
@@ -28,7 +28,7 @@ defineOptions({
<div
class="text-muted-foreground absolute bottom-3 flex text-center text-xs"
>
{{ preference.copyright }}
{{ preferences.app.copyright }}
</div>
</div>
</template>

View File

@@ -1 +1 @@
export { default as AuthPageLayout } from './authentication.vue';
export { default as AuthPageLayoutType } from './authentication.vue';