refactor(project): business changed its name to effects, and universal-ui changed its name to common-ui
This commit is contained in:
61
packages/effects/layouts/src/widgets/layout-toggle.vue
Normal file
61
packages/effects/layouts/src/widgets/layout-toggle.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<script setup lang="ts">
|
||||
import type { VbenDropdownMenuItem } from '@vben-core/shadcn-ui';
|
||||
import type { AuthPageLayoutType } from '@vben-core/typings';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { MdiDockBottom, MdiDockLeft, MdiDockRight } from '@vben-core/iconify';
|
||||
import { $t } from '@vben-core/locales';
|
||||
import {
|
||||
preferences,
|
||||
updatePreferences,
|
||||
usePreferences,
|
||||
} from '@vben-core/preferences';
|
||||
import { VbenDropdownRadioMenu, VbenIconButton } from '@vben-core/shadcn-ui';
|
||||
|
||||
defineOptions({
|
||||
name: 'AuthenticationLayoutToggle',
|
||||
});
|
||||
|
||||
const menus = computed((): VbenDropdownMenuItem[] => [
|
||||
{
|
||||
icon: MdiDockLeft,
|
||||
key: 'panel-left',
|
||||
text: $t('authentication.layout.alignLeft'),
|
||||
},
|
||||
{
|
||||
icon: MdiDockBottom,
|
||||
key: 'panel-center',
|
||||
text: $t('authentication.layout.center'),
|
||||
},
|
||||
{
|
||||
icon: MdiDockRight,
|
||||
key: 'panel-right',
|
||||
text: $t('authentication.layout.alignRight'),
|
||||
},
|
||||
]);
|
||||
|
||||
const { authPanelCenter, authPanelLeft, authPanelRight } = usePreferences();
|
||||
|
||||
function handleUpdate(value: string) {
|
||||
updatePreferences({
|
||||
app: {
|
||||
authPageLayout: value as AuthPageLayoutType,
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VbenDropdownRadioMenu
|
||||
:menus="menus"
|
||||
:model-value="preferences.app.authPageLayout"
|
||||
@update:model-value="handleUpdate"
|
||||
>
|
||||
<VbenIconButton>
|
||||
<MdiDockRight v-if="authPanelRight" class="size-5" />
|
||||
<MdiDockLeft v-if="authPanelLeft" class="size-5" />
|
||||
<MdiDockBottom v-if="authPanelCenter" class="size-5" />
|
||||
</VbenIconButton>
|
||||
</VbenDropdownRadioMenu>
|
||||
</template>
|
Reference in New Issue
Block a user