File tree Expand file tree Collapse file tree 4 files changed +68
-2
lines changed Expand file tree Collapse file tree 4 files changed +68
-2
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ const Menus = defineComponent({
7171 if ( ! menu . children || ! menu . children . length ) {
7272 return (
7373 < Menu . Item key = { menu . path } >
74+ { menus . meta ?. icon && (
75+ < span
76+ class = { `iconfont ${ menu . meta . icon } menu-icon` }
77+ > </ span >
78+ ) }
7479 < span > { menu . meta ?. title } </ span >
7580 </ Menu . Item >
7681 )
Original file line number Diff line number Diff line change 11import { defineComponent } from 'vue'
22import { RouterView } from 'vue-router'
3- import { Layout } from 'ant-design-vue'
3+ import { Layout , Dropdown } from 'ant-design-vue'
44import { GlobalHeader , Menus } from '@/components/GlobalHeader'
55
66import styles from './index.module.less'
7+ import UserIcon from '../assets/user.png'
78
89const LevelBasicLayout = defineComponent ( {
910 name : 'LevelBasicLayout' ,
1011 setup ( ) {
1112 const slots = {
12- content : ( ) => < Menus > </ Menus > ,
13+ content : ( ) => (
14+ < >
15+ { /* 导航栏 */ }
16+ < Menus > </ Menus >
17+ { /* 用户信息 */ }
18+ < div class = { styles [ 'user-info' ] } >
19+ < Dropdown >
20+ < div >
21+ < img src = { UserIcon } class = { styles [ 'user-head' ] } />
22+ < a class = { styles [ 'user-name' ] } > admin</ a >
23+ </ div >
24+ </ Dropdown >
25+ </ div >
26+ </ >
27+ ) ,
1328 }
1429 return ( ) => (
1530 < Layout class = { styles [ 'level-layout' ] } >
Original file line number Diff line number Diff line change 66 height : 100% ;
77 }
88 }
9+ .user-info {
10+ min-width : 100px ;
11+ display : flex ;
12+ flex-flow : row nowrap ;
13+ align-items : center ;
14+ justify-content : flex-end ;
15+ .lang-box {
16+ width : 80px ;
17+ margin-right : 10px ;
18+ & .ant-select {
19+ font-size : 12px ;
20+ }
21+ .ant-select-selection {
22+ background : transparent ;
23+ border : 1px solid #a7a5a5 ;
24+ color : #fff ;
25+ }
26+ .ant-select-arrow {
27+ color : #fff ;
28+ font-size : 10px ;
29+ }
30+ }
31+ .ant-dropdown-trigger {
32+ height : 54px ;
33+ line-height : 54px ;
34+ }
35+ .user-head {
36+ width : 30px ;
37+ height : 30px ;
38+ margin-right : 10px ;
39+ margin-top : -4px ;
40+ }
41+ .user-name {
42+ line-height : 54px ;
43+ font-size : 16px ;
44+ color : rgba (255 , 255 , 255 , 0.85 );
45+ }
46+ .icon {
47+ line-height : 54px ;
48+ font-size : 24px ;
49+ font-weight : bold ;
50+ color : #fff ;
51+ margin-left : 10px ;
52+ cursor : pointer ;
53+ }
54+ }
955}
1056
1157.page-view {
You can’t perform that action at this time.
0 commit comments