Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-pc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
topsun-baoshen-pc
Commits
0e5a04c2
Commit
0e5a04c2
authored
Oct 26, 2023
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加菜单图标显示
parent
381e535f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
15 deletions
+17
-15
components.d.ts
components.d.ts
+1
-1
index.ts
src/components/SvgIcon/index.ts
+0
-3
index.vue
src/components/SvgIcon/index.vue
+0
-0
home.svg
src/icons/home.svg
+1
-0
system.svg
src/icons/system.svg
+1
-0
BasicItemContent.vue
src/layouts/default/menu/components/BasicItemContent.vue
+4
-7
BasicSubMenuItem.vue
src/layouts/default/menu/components/BasicSubMenuItem.vue
+5
-1
index.ts
src/router/routes/index.ts
+2
-1
permission.ts
src/stores/modules/permission.ts
+2
-1
tsconfig.app.json
tsconfig.app.json
+1
-1
No files found.
components.d.ts
View file @
0e5a04c2
...
...
@@ -9,6 +9,6 @@ declare module 'vue' {
export
interface
GlobalComponents
{
RouterLink
:
typeof
import
(
'vue-router'
)[
'RouterLink'
]
RouterView
:
typeof
import
(
'vue-router'
)[
'RouterView'
]
SvgIcon
:
typeof
import
(
'./src/components/SvgIcon/
src/
index.vue'
)[
'default'
]
SvgIcon
:
typeof
import
(
'./src/components/SvgIcon/index.vue'
)[
'default'
]
}
}
src/components/SvgIcon/index.ts
deleted
100644 → 0
View file @
381e535f
import
SvgIcon
from
'./src/index.vue'
export
{
SvgIcon
}
src/components/SvgIcon/
src/
index.vue
→
src/components/SvgIcon/index.vue
View file @
0e5a04c2
File moved
src/icons/home.svg
0 → 100644
View file @
0e5a04c2
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1698287704571"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4022"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"81"
height=
"81"
><path
d=
"M946.5 505L534.6 93.4c-12.5-12.5-32.7-12.5-45.2 0L77.5 505c-12 12-18.8 28.3-18.8 45.3 0 35.3 28.7 64 64 64h43.4V908c0 17.7 14.3 32 32 32H448V716h112v224h265.9c17.7 0 32-14.3 32-32V614.3h43.4c17 0 33.3-6.7 45.3-18.8 24.9-25 24.9-65.5-0.1-90.5z"
p-id=
"4023"
></path></svg>
\ No newline at end of file
src/icons/system.svg
0 → 100644
View file @
0e5a04c2
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1698289279223"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"7455"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"81"
height=
"81"
><path
d=
"M410.67 544H133.33A69.33 69.33 0 0 0 64 613.33v277.34A69.33 69.33 0 0 0 133.33 960h277.34A69.33 69.33 0 0 0 480 890.67V613.33A69.33 69.33 0 0 0 410.67 544zM402 842a40 40 0 0 1-40 40H182a40 40 0 0 1-40-40V662a40 40 0 0 1 40-40h180a40 40 0 0 1 40 40zM890.67 544H613.33A69.33 69.33 0 0 0 544 613.33v277.34A69.33 69.33 0 0 0 613.33 960h277.34A69.33 69.33 0 0 0 960 890.67V613.33A69.33 69.33 0 0 0 890.67 544zM882 842a40 40 0 0 1-40 40H662a40 40 0 0 1-40-40V662a40 40 0 0 1 40-40h180a40 40 0 0 1 40 40zM410.67 64H133.33A69.33 69.33 0 0 0 64 133.33v277.34A69.33 69.33 0 0 0 133.33 480h277.34A69.33 69.33 0 0 0 480 410.67V133.33A69.33 69.33 0 0 0 410.67 64zM402 362a40 40 0 0 1-40 40H182a40 40 0 0 1-40-40V182a40 40 0 0 1 40-40h180a40 40 0 0 1 40 40zM694.49 456.18a81.35 81.35 0 0 0 115 0l126.69-126.67a81.35 81.35 0 0 0 0-115L809.51 87.82a81.35 81.35 0 0 0-115 0L567.82 214.49a81.35 81.35 0 0 0 0 115z"
fill=
"currentColor"
p-id=
"7456"
></path></svg>
\ No newline at end of file
src/layouts/default/menu/components/BasicItemContent.vue
View file @
0e5a04c2
<
template
>
<span>
<ContainerOutlined
v-if=
"item.meta?.icon"
/>
{{
item
.
meta
.
title
}}
</span>
<span>
{{
item
.
meta
.
title
}}
</span>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
import
{
ContainerOutlined
}
from
'@ant-design/icons-vue'
import
{
useMenuSetting
}
from
'@/hooks/setting/useMenuSetting'
export
default
defineComponent
({
name
:
'BasicItemContent'
,
components
:
{
ContainerOutlined
},
...
...
@@ -19,6 +18,4 @@ export default defineComponent({
}
})
</
script
>
<
style
lang=
"less"
scoped
>
</
style
>
<
style
lang=
"less"
scoped
></
style
>
src/layouts/default/menu/components/BasicSubMenuItem.vue
View file @
0e5a04c2
...
...
@@ -5,6 +5,9 @@
:key=
"`submenu-$
{item.path}`"
popupClassName="app-top-menu-popup"
>
<template
#
icon
>
<SvgIcon
v-if=
"item.meta?.icon"
:name=
"item.meta.icon"
/>
</
template
>
<
template
#
title
>
<MenuItemContent
v-bind=
"$props"
:item=
"item"
/>
</
template
>
...
...
@@ -19,11 +22,12 @@
import
{
computed
,
defineComponent
}
from
'vue'
import
BasicMenuItem
from
'./BasicMenuItem.vue'
import
MenuItemContent
from
'./BasicItemContent.vue'
import
SvgIcon
from
'@/components/SvgIcon/index.vue'
import
{
Menu
}
from
'ant-design-vue'
export
default
defineComponent
({
name
:
'BasicSubMenuItem'
,
components
:
{
BasicMenuItem
,
MenuItemContent
,
SubMenu
:
Menu
.
SubMenu
},
components
:
{
BasicMenuItem
,
MenuItemContent
,
SubMenu
:
Menu
.
SubMenu
,
SvgIcon
},
props
:
{
item
:
{
type
:
Object
,
...
...
src/router/routes/index.ts
View file @
0e5a04c2
...
...
@@ -11,7 +11,8 @@ export const RootRoute: AppRouteRecordRaw = {
component
:
LAYOUT
,
redirect
:
PageEnum
.
BASE_HOME
,
meta
:
{
title
:
'首页'
title
:
'首页'
,
icon
:
'home'
},
children
:
[
{
...
...
src/stores/modules/permission.ts
View file @
0e5a04c2
...
...
@@ -27,7 +27,8 @@ const filterAsyncRoute = (routes: UserRoute[]): AppRouteRecordRaw[] => {
hideMenu
:
!!
_route
.
hidden
,
isLink
:
_route
.
internalOrExternal
,
keepAlive
:
_route
.
keepAlive
,
title
:
_route
.
permissionName
title
:
_route
.
permissionName
,
icon
:
_route
.
permissionIcon
||
''
},
children
:
_route
.
childNode
!==
null
?
filterAsyncRoute
(
_route
.
childNode
)
:
[]
}
...
...
tsconfig.app.json
View file @
0e5a04c2
{
"extends"
:
"@vue/tsconfig/tsconfig.dom.json"
,
"include"
:
[
"env.d.ts"
,
"src/**/*"
,
"src/**/*.vue"
,
"src/**/*.ts"
,
"scr/*.vue"
],
"include"
:
[
"env.d.ts"
,
"src/**/*"
,
"src/**/*.vue"
,
"src/**/*.ts"
],
"exclude"
:
[
"src/**/__tests__/*"
],
"compilerOptions"
:
{
"composite"
:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment