Skip to content

Commit

Permalink
feat(projects): 新增子菜单图标和多页签图标
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Mar 4, 2022
1 parent a1a57a1 commit f5c56c3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 25 deletions.
77 changes: 52 additions & 25 deletions mock/api/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '分析页',
requiresAuth: true
requiresAuth: true,
icon: 'icon-park-outline:analysis'
}
},
{
Expand All @@ -22,7 +23,8 @@ const routes: AuthRoute.Route[] = [
meta: {
title: '工作台',
requiresAuth: true,
permissions: ['super', 'admin']
permissions: ['super', 'admin'],
icon: 'icon-park-outline:workbench'
}
}
],
Expand All @@ -43,7 +45,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: 'vue文档',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:vuejs'
}
},
{
Expand All @@ -52,7 +55,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: 'vue文档(新版)',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:vuejs'
}
},
{
Expand All @@ -61,7 +65,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: 'vite文档',
requiresAuth: true
requiresAuth: true,
icon: 'simple-icons:vite'
}
},
{
Expand All @@ -70,7 +75,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: 'naive文档',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:alpha-n-box-outline'
}
},
{
Expand All @@ -79,6 +85,7 @@ const routes: AuthRoute.Route[] = [
meta: {
title: '项目文档(外链)',
requiresAuth: true,
icon: 'mdi:file-link-outline',
href: 'https://docs.soybean.pro/'
}
}
Expand All @@ -100,7 +107,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '按钮',
requiresAuth: true
requiresAuth: true,
icon: 'ic:baseline-radio-button-checked'
}
},
{
Expand All @@ -109,7 +117,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '卡片',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:card-outline'
}
},
{
Expand All @@ -118,7 +127,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '表格',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:table-large'
}
}
],
Expand All @@ -139,7 +149,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '地图',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:map'
}
},
{
Expand All @@ -148,7 +159,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '视频',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:video'
}
},
{
Expand All @@ -161,21 +173,25 @@ const routes: AuthRoute.Route[] = [
path: '/plugin/editor/quill',
component: 'self',
meta: {
title: '富文本编辑器'
title: '富文本编辑器',
requiresAuth: true,
icon: 'mdi:file-document-edit-outline'
}
},
{
name: 'plugin_editor_markdown',
path: '/plugin/editor/markdown',
component: 'self',
meta: {
title: 'markdown编辑器'
title: 'markdown编辑器',
requiresAuth: true,
icon: 'ri:markdown-line'
}
}
],
meta: {
title: '编辑器',
requiresAuth: true
icon: 'icon-park-outline:editor'
}
},
{
Expand All @@ -184,7 +200,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: 'Swiper插件',
requiresAuth: true
requiresAuth: true,
icon: 'simple-icons:swiper'
}
},
{
Expand All @@ -193,7 +210,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '剪贴板',
requiresAuth: true
requiresAuth: true,
icon: 'mdi:clipboard-outline'
}
},
{
Expand All @@ -202,7 +220,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '图标',
requiresAuth: true
requiresAuth: true,
icon: 'ic:baseline-insert-emoticon'
}
},
{
Expand All @@ -211,7 +230,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '打印',
requiresAuth: true
requiresAuth: true,
icon: 'ic:baseline-local-printshop'
}
}
],
Expand All @@ -232,7 +252,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '异常页403',
requiresAuth: true
requiresAuth: true,
icon: 'ic:baseline-block'
}
},
{
Expand All @@ -241,7 +262,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '异常页404',
requiresAuth: true
requiresAuth: true,
icon: 'ic:baseline-web-asset-off'
}
},
{
Expand All @@ -250,7 +272,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '异常页500',
requiresAuth: true
requiresAuth: true,
icon: 'ic:baseline-wifi-off'
}
}
],
Expand All @@ -276,7 +299,8 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '二级菜单',
requiresAuth: true
requiresAuth: true,
icon: 'ic:outline-menu'
}
},
{
Expand All @@ -290,17 +314,20 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '三级菜单',
requiresAuth: true
requiresAuth: true,
icon: 'ic:outline-menu'
}
}
],
meta: {
title: '二级菜单(有子菜单)'
title: '二级菜单(有子菜单)',
icon: 'ic:outline-menu'
}
}
],
meta: {
title: '一级菜单'
title: '一级菜单',
icon: 'ic:outline-menu'
}
}
],
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/common/GlobalTab/components/TabDetail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@close="tab.removeTab(item.path)"
@contextmenu="handleContextMenu($event, item.path)"
>
<Icon v-if="item.meta.icon" :icon="item.meta.icon" class="inline-block align-text-bottom mr-4px text-16px" />
{{ item.meta.title }}
</component>
</div>
Expand All @@ -28,6 +29,7 @@
import { ref, reactive, computed, nextTick, watch } from 'vue';
import { useEventListener } from '@vueuse/core';
import { ChromeTab, ButtonTab } from 'soybean-admin-tab';
import { Icon } from '@iconify/vue';
import { useThemeStore, useTabStore } from '@/store';
import { setTabRoutes } from '@/utils';
import { ContextMenu } from './components';
Expand Down

1 comment on commit f5c56c3

@vercel
Copy link

@vercel vercel bot commented on f5c56c3 Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.