-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from sugarforever/feat/topHeader
顶部导航栏支持响应式
- Loading branch information
Showing
3 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts" setup> | ||
const menus = useMenus() | ||
</script> | ||
|
||
<template> | ||
<div class="w-full box-border"> | ||
<ul class="p-4"> | ||
<li v-for="menu in menus" :key="menu.to" class="my-1"> | ||
<RouterLink :to="menu.to" | ||
active-class="!text-primary-400" | ||
class="block px-2 py-1 text-gray-500 hover:text-gray-800 dark:text-gray-300 dark:hover:text-gray-100"> | ||
<Icon :name="menu.icon" /> | ||
<span class="ml-2">{{ menu.label }}</span> | ||
</RouterLink> | ||
</li> | ||
</ul> | ||
<div class="flex items-center p-4 border-t border-gray-200 dark:border-gray-700"> | ||
<div class="mr-4"> | ||
<ColorMode /> | ||
</div> | ||
<ULink to="https://github.com/sugarforever/chat-ollama" | ||
target="_blank" | ||
class="i-mdi-github text-2xl ml-2 mr-4"></ULink> | ||
<Auth class="ml-auto" /> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function useMenus() { | ||
const { t } = useI18n() | ||
|
||
return computed(() => [ | ||
{ label: t('menu.home'), icon: 'i-heroicons-home', to: '/' }, | ||
{ label: t('menu.models'), icon: 'i-heroicons-rectangle-stack', to: '/models' }, | ||
{ label: t('menu.instructions'), icon: 'i-iconoir-terminal', to: '/instructions' }, | ||
{ label: t('menu.knowledgeBases'), icon: 'i-heroicons-book-open', to: '/knowledgebases' }, | ||
{ label: t('menu.chat'), icon: 'i-iconoir-chat-lines', to: '/chat' }, | ||
{ label: t('menu.settings'), icon: 'i-heroicons-cog-6-tooth', to: '/settings' } | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters