feat(projects): 头部添加菜单折叠按钮和github地址
This commit is contained in:
parent
3226a724be
commit
3ec1fc8f0c
@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<header-item class="w-40px h-full" @click="toggle">
|
||||||
|
<icon-gridicons-fullscreen-exit v-if="isFullscreen" class="text-16px" />
|
||||||
|
<icon-gridicons-fullscreen v-else class="text-16px" />
|
||||||
|
</header-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useFullscreen } from '@vueuse/core';
|
||||||
|
import HeaderItem from './HeaderItem.vue';
|
||||||
|
|
||||||
|
const { isFullscreen, toggle } = useFullscreen();
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -0,0 +1,12 @@
|
|||||||
|
<template>
|
||||||
|
<header-item class="w-40px h-full">
|
||||||
|
<a href="https://github.com/honghuangdc/soybean-admin" target="_blank" class="flex-center">
|
||||||
|
<icon-mdi-github class="text-20px text-[#666]" />
|
||||||
|
</a>
|
||||||
|
</header-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import HeaderItem from './HeaderItem.vue';
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<header-item class="w-40px h-full" @click="toggleMenu">
|
||||||
|
<icon-line-md-menu-unfold-left v-if="app.menu.collapsed" class="text-16px" />
|
||||||
|
<icon-line-md-menu-fold-left v-else class="text-16px" />
|
||||||
|
</header-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useAppStore } from '@/store';
|
||||||
|
import HeaderItem from './HeaderItem.vue';
|
||||||
|
|
||||||
|
const app = useAppStore();
|
||||||
|
const { toggleMenu } = useAppStore();
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<header-item class="w-40px h-full" @click="openSettingDrawer">
|
||||||
|
<icon-mdi-light-cog class="text-16px" />
|
||||||
|
</header-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useAppStore } from '@/store';
|
||||||
|
import HeaderItem from './HeaderItem.vue';
|
||||||
|
|
||||||
|
const { openSettingDrawer } = useAppStore();
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-dropdown :options="options" @select="handleDropdown">
|
<n-dropdown :options="options" @select="handleDropdown">
|
||||||
<header-item class="px-12px">
|
<header-item class="px-12px">
|
||||||
<n-avatar :src="avatar" :round="true" />
|
<n-avatar :src="avatar" size="small" :round="true" />
|
||||||
<span class="pl-8px text-16px font-medium">Soybean</span>
|
<span class="pl-8px text-16px font-medium">Soybean</span>
|
||||||
</header-item>
|
</header-item>
|
||||||
</n-dropdown>
|
</n-dropdown>
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
import UserAvatar from './UserAvatar.vue';
|
import UserAvatar from './UserAvatar.vue';
|
||||||
|
import MenuCollapse from './MenuCollapse.vue';
|
||||||
|
import FullScreen from './FullScreen.vue';
|
||||||
|
import SettingDrawerButton from './SettingDrawerButton.vue';
|
||||||
|
import GihubSite from './GihubSite.vue';
|
||||||
import HeaderItem from './HeaderItem.vue';
|
import HeaderItem from './HeaderItem.vue';
|
||||||
|
|
||||||
export { UserAvatar, HeaderItem };
|
export { UserAvatar, MenuCollapse, FullScreen, SettingDrawerButton, GihubSite, HeaderItem };
|
||||||
|
@ -5,15 +5,12 @@
|
|||||||
<div v-if="!theme.isVerticalNav" class="menu-width h-full">
|
<div v-if="!theme.isVerticalNav" class="menu-width h-full">
|
||||||
<global-logo />
|
<global-logo />
|
||||||
</div>
|
</div>
|
||||||
|
<menu-collapse />
|
||||||
<div class="flex-1 flex justify-end h-full">
|
<div class="flex-1 flex justify-end h-full">
|
||||||
<header-item class="w-40px h-full" @click="toggle">
|
<gihub-site />
|
||||||
<icon-gridicons-fullscreen-exit v-if="isFullscreen" class="text-16px" />
|
<full-screen />
|
||||||
<icon-gridicons-fullscreen v-else class="text-16px" />
|
|
||||||
</header-item>
|
|
||||||
<user-avatar />
|
<user-avatar />
|
||||||
<header-item class="w-40px h-full" @click="openSettingDrawer">
|
<setting-drawer-button />
|
||||||
<icon-mdi-light-cog class="text-16px" />
|
|
||||||
</header-item>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</n-layout-header>
|
</n-layout-header>
|
||||||
@ -22,9 +19,8 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { NLayoutHeader } from 'naive-ui';
|
import { NLayoutHeader } from 'naive-ui';
|
||||||
import { useFullscreen } from '@vueuse/core';
|
import { useThemeStore } from '@/store';
|
||||||
import { useAppStore, useThemeStore } from '@/store';
|
import { UserAvatar, MenuCollapse, FullScreen, GihubSite, SettingDrawerButton } from './components';
|
||||||
import { UserAvatar, HeaderItem } from './components';
|
|
||||||
import { GlobalLogo } from '../common';
|
import { GlobalLogo } from '../common';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
@ -34,9 +30,7 @@ defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { openSettingDrawer } = useAppStore();
|
|
||||||
const theme = useThemeStore();
|
const theme = useThemeStore();
|
||||||
const { isFullscreen, toggle } = useFullscreen();
|
|
||||||
|
|
||||||
const inverted = computed(() => {
|
const inverted = computed(() => {
|
||||||
return theme.navStyle.theme !== 'light';
|
return theme.navStyle.theme !== 'light';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-layout-sider
|
<n-layout-sider
|
||||||
class="sider-shadow h-full"
|
class="global-sider h-full"
|
||||||
:style="{ zIndex }"
|
:style="{ zIndex }"
|
||||||
:native-scrollbar="false"
|
:native-scrollbar="false"
|
||||||
:inverted="inverted"
|
:inverted="inverted"
|
||||||
@ -46,7 +46,8 @@ const menuWidth = computed(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.sider-shadow {
|
.global-sider {
|
||||||
|
transition: all 0.2s ease-in-out;
|
||||||
box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%);
|
box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -141,6 +141,7 @@ export const customRoutes: CustomRoute[] = [
|
|||||||
component: () => import('@/views/system/exception/403.vue'),
|
component: () => import('@/views/system/exception/403.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: EnumRouteTitle['exception-403'],
|
title: EnumRouteTitle['exception-403'],
|
||||||
|
fullPage: true,
|
||||||
asMenu: true
|
asMenu: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -150,6 +151,7 @@ export const customRoutes: CustomRoute[] = [
|
|||||||
component: () => import('@/views/system/exception/404.vue'),
|
component: () => import('@/views/system/exception/404.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: EnumRouteTitle['exception-404'],
|
title: EnumRouteTitle['exception-404'],
|
||||||
|
fullPage: true,
|
||||||
asMenu: true
|
asMenu: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -159,7 +161,8 @@ export const customRoutes: CustomRoute[] = [
|
|||||||
component: () => import('@/views/system/exception/500.vue'),
|
component: () => import('@/views/system/exception/500.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: EnumRouteTitle['exception-500'],
|
title: EnumRouteTitle['exception-500'],
|
||||||
asMenu: false
|
fullPage: true,
|
||||||
|
asMenu: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -2,14 +2,12 @@
|
|||||||
<div class="p-10px">
|
<div class="p-10px">
|
||||||
<data-card :loading="loading" />
|
<data-card :loading="loading" />
|
||||||
<nav-card :loading="loading" />
|
<nav-card :loading="loading" />
|
||||||
<router-link :to="EnumRoutePath['dashboard-workbench']">workbench</router-link>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { DataCard, NavCard } from './components';
|
import { DataCard, NavCard } from './components';
|
||||||
import { EnumRoutePath } from '@/enum';
|
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user