Download packages/effects/layouts/src/authentication/toolbar.vue from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 1.39 kB
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/packages/effects/layouts/src/authentication/toolbar.vue
- Command line
-
hf download hf://spaces/binhugg3/admin/packages/effects/layouts/src/authentication/toolbar.vue
-
curl -L -o toolbar.vue https://huggingface.co/spaces/binhugg3/admin/resolve/main/packages/effects/layouts/src/authentication/toolbar.vue
1.39 kB
| <script setup lang="ts"> | |
| import type { ToolbarType } from './types'; | |
| import { computed } from 'vue'; | |
| import { preferences } from '@vben/preferences'; | |
| import { | |
| AuthenticationColorToggle, | |
| AuthenticationLayoutToggle, | |
| LanguageToggle, | |
| ThemeToggle, | |
| } from '../widgets'; | |
| interface Props { | |
| toolbarList?: ToolbarType[]; | |
| } | |
| defineOptions({ | |
| name: 'AuthenticationToolbar', | |
| }); | |
| const props = withDefaults(defineProps<Props>(), { | |
| toolbarList: () => ['color', 'language', 'layout', 'theme'], | |
| }); | |
| const showColor = computed(() => props.toolbarList.includes('color')); | |
| const showLayout = computed(() => props.toolbarList.includes('layout')); | |
| const showLanguage = computed(() => props.toolbarList.includes('language')); | |
| const showTheme = computed(() => props.toolbarList.includes('theme')); | |
| </script> | |
| <template> | |
| <div | |
| :class="{ | |
| 'bg-accent rounded-3xl px-3 py-1': toolbarList.length > 1, | |
| }" | |
| class="flex-center absolute right-2 top-4 z-10" | |
| > | |
| <!-- Only show on medium and larger screens --> | |
| <div class="hidden md:flex"> | |
| <AuthenticationColorToggle v-if="showColor" /> | |
| <AuthenticationLayoutToggle v-if="showLayout" /> | |
| </div> | |
| <!-- Always show Language and Theme toggles --> | |
| <LanguageToggle v-if="showLanguage && preferences.widget.languageToggle" /> | |
| <ThemeToggle v-if="showTheme && preferences.widget.themeToggle" /> | |
| </div> | |
| </template> | |