mirror of https://github.com/certd/certd
chore: 优化
parent
0c8a84656a
commit
0f5b9564c6
|
@ -1,7 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
|
||||
const props = defineProps<{
|
||||
showIcon?: boolean;
|
||||
}>();
|
||||
|
||||
const openedRef = ref(false);
|
||||
function open() {
|
||||
openedRef.value = true;
|
||||
|
@ -12,8 +16,8 @@ const slots = defineSlots();
|
|||
<template>
|
||||
<div class="tutorial-button pointer" @click="open">
|
||||
<template v-if="!slots.default">
|
||||
<fs-icon icon="ant-design:question-circle-outlined"></fs-icon>
|
||||
<div class="hidden md:block ml-0.5">使用教程</div>
|
||||
<fs-icon v-if="showIcon" icon="ant-design:question-circle-outlined"></fs-icon>
|
||||
<div class="hidden md:block">使用教程</div>
|
||||
</template>
|
||||
<slot></slot>
|
||||
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
||||
|
|
|
@ -63,9 +63,6 @@ onMounted(async () => {
|
|||
<LockScreen :avatar @to-login="handleLogout" />
|
||||
</template>
|
||||
<template #header-right-0>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
|
||||
<tutorial-button v-if="!settingStore.isComm" class="flex-center header-btn" />
|
||||
</div>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<vip-button class="flex-center header-btn" mode="nav" />
|
||||
</div>
|
||||
|
|
|
@ -1,54 +1,40 @@
|
|||
import { IFrameView } from "/@/vben/layouts";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { computed } from "vue";
|
||||
|
||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||
export const aboutResource = [
|
||||
{
|
||||
title: "文档",
|
||||
name: "about",
|
||||
path: "/about",
|
||||
redirect: "/about/doc",
|
||||
name: "document",
|
||||
path: "/about/doc",
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: "lucide:book-open-text",
|
||||
link: "https://certd.docmirror.cn",
|
||||
title: "文档",
|
||||
order: 9999,
|
||||
show: () => {
|
||||
const settingStore = useSettingStore();
|
||||
return !settingStore.isComm;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "教程",
|
||||
name: "help",
|
||||
path: "/help",
|
||||
meta: {
|
||||
icon: "lucide:copyright",
|
||||
order: 9999,
|
||||
show: () => {
|
||||
const settingStore = useSettingStore();
|
||||
return !settingStore.isComm;
|
||||
}
|
||||
},
|
||||
children: [
|
||||
{
|
||||
title: "文档",
|
||||
name: "document",
|
||||
path: "/about/doc",
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: "lucide:book-open-text",
|
||||
link: "https://certd.docmirror.cn",
|
||||
title: "文档"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Github",
|
||||
path: "/about/github",
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: "mdi:github",
|
||||
link: "https://github.com/certd/certd",
|
||||
title: "Github"
|
||||
}
|
||||
slot() {
|
||||
return <TutorialButton className="flex-center" show-icon={false} />;
|
||||
},
|
||||
{
|
||||
name: "Gitee",
|
||||
path: "/about/gitee",
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: "ion:logo-octocat",
|
||||
link: "https://gitee.com/certd/certd",
|
||||
title: "Gite"
|
||||
}
|
||||
}
|
||||
]
|
||||
click() {}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -48,6 +48,10 @@ function handleClick() {
|
|||
if (props.disabled) {
|
||||
return;
|
||||
}
|
||||
if (props.click) {
|
||||
props.click();
|
||||
return;
|
||||
}
|
||||
rootMenu?.handleMenuItemClick?.({
|
||||
parentPaths: parentPaths.value,
|
||||
path: props.path
|
||||
|
|
|
@ -40,14 +40,14 @@ const hasChildren = computed(() => {
|
|||
:badge-variants="menu.badgeVariants"
|
||||
:icon="menu.icon"
|
||||
:path="menu.path"
|
||||
@click="menu.meta?.onClick"
|
||||
:click="menu.meta?.click"
|
||||
>
|
||||
<template #title>
|
||||
<span>{{ menu.name }}</span>
|
||||
</template>
|
||||
<template v-if="menu.meta?.slot" #default>
|
||||
<fs-render :render-func="menu.meta.slot" />
|
||||
</template>
|
||||
<template v-else #title>
|
||||
<span>{{ menu.name }}</span>
|
||||
</template>
|
||||
</MenuItem>
|
||||
<SubMenuComp v-else :key="`${menu.path}_sub`" :active-icon="menu.activeIcon" :icon="menu.icon" :path="menu.path">
|
||||
<template #content>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Component, Ref } from 'vue';
|
||||
import type { Component, Ref } from "vue";
|
||||
|
||||
import type { MenuRecordBadgeRaw, ThemeModeType } from '/@/vben/typings';
|
||||
import type { MenuRecordBadgeRaw, ThemeModeType } from "/@/vben/typings";
|
||||
|
||||
interface MenuProps {
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ interface MenuProps {
|
|||
* @zh_CN 菜单模式
|
||||
* @default vertical
|
||||
*/
|
||||
mode?: 'horizontal' | 'vertical';
|
||||
mode?: "horizontal" | "vertical";
|
||||
|
||||
/**
|
||||
* @zh_CN 是否圆润风格
|
||||
|
@ -85,6 +85,7 @@ interface MenuItemProps extends MenuRecordBadgeRaw {
|
|||
* @zh_CN menuitem 名称
|
||||
*/
|
||||
path: string;
|
||||
click?: any;
|
||||
}
|
||||
|
||||
interface MenuItemRegistered {
|
||||
|
@ -128,12 +129,4 @@ interface SubMenuProvider {
|
|||
removeSubMenu: (item: MenuItemRegistered) => void;
|
||||
}
|
||||
|
||||
export type {
|
||||
MenuItemClicked,
|
||||
MenuItemProps,
|
||||
MenuItemRegistered,
|
||||
MenuProps,
|
||||
MenuProvider,
|
||||
SubMenuProps,
|
||||
SubMenuProvider,
|
||||
};
|
||||
export type { MenuItemClicked, MenuItemProps, MenuItemRegistered, MenuProps, MenuProvider, SubMenuProps, SubMenuProvider };
|
||||
|
|
Loading…
Reference in New Issue