File tree Expand file tree Collapse file tree 6 files changed +58
-45
lines changed Expand file tree Collapse file tree 6 files changed +58
-45
lines changed Original file line number Diff line number Diff line change @@ -491,46 +491,31 @@ export declare class CSidebarHeader extends Vue {}
491
491
492
492
export declare class CSidebarMinimizer extends Vue { }
493
493
494
- export declare class CSidebarNav extends Vue {
495
- navItems : Array < any >
496
- }
494
+ export declare class CSidebarNav extends Vue { }
497
495
498
496
export declare class CSidebarNavDivider extends Vue { }
499
497
500
498
export declare class CSidebarNavDropdown extends Vue {
501
499
name : string
502
500
route : string
503
- icon : string
501
+ icon : [ string , object ]
502
+ fontIcon : string
504
503
show : boolean
505
504
}
506
505
507
- export declare class CSidebarNavItem extends Vue {
508
- item : object
509
- }
510
-
511
- export declare class CSidebarNavItems extends Vue {
512
- items : Array < any >
513
- }
514
-
515
- export declare class CSidebarNavLabel extends Vue {
516
- name : string
517
- url : string
518
- icon : string
519
- }
506
+ export declare class CSidebarNavItem extends Vue { }
520
507
521
508
export declare class CSidebarNavLink extends CLink {
522
509
name : string
523
- icon : [ string , Array < any > , object ]
510
+ icon : [ string , object ]
511
+ fontIcon : string
524
512
badge : object
525
513
url : string
514
+ label : boolean
515
+ inNavItem : boolean
526
516
}
527
517
528
- export declare class CSidebarNavTitle extends Vue {
529
- name : string
530
- wrapper : object
531
- }
532
-
533
- export declare class CSidebarNavToggler extends Vue { }
518
+ export declare class CSidebarNavTitle extends Vue { }
534
519
535
520
export declare class CSpinner extends Vue {
536
521
grow : boolean
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<li :class =" dropdownClasses" >
3
- <a class =" c-sidebar-nav-link c-sidebar-nav- dropdown-toggle" @click =" handleClick" >
3
+ <a class =" c-sidebar-nav-dropdown-toggle" @click =" handleClick" >
4
4
<CIcon v-if =" icon" v-bind =" computedIcon" />
5
+ <i v-if =" fontIcon" :class =" ['c-sidebar-nav-icon', fontIcon]" ></i >
5
6
{{name}}
6
7
</a >
7
8
<ul class =" c-sidebar-nav-dropdown-items" @click =" itemClicked" >
11
12
</template >
12
13
13
14
<script >
14
- // import CIcon from '@coreui/icons/ vue'
15
+ import CIcon from ' @coreui/icons-vue/CIcon. vue'
15
16
16
17
export default {
17
18
name: ' CSidebarNavDropdown' ,
18
- // components: {
19
- // CIcon
20
- // },
19
+ components: {
20
+ CIcon
21
+ },
21
22
props: {
22
23
name: String ,
23
24
route: {
24
25
type: String ,
25
26
validator : val => val .length > 0
26
27
},
27
28
icon: [String , Object ],
29
+ fontIcon: String ,
28
30
show: Boolean
29
31
},
30
32
data () {
@@ -64,7 +66,7 @@ export default {
64
66
},
65
67
dropdownClasses () {
66
68
return [
67
- ' c-sidebar-nav-item c-sidebar-nav- dropdown' ,
69
+ ' c-sidebar-nav-dropdown' ,
68
70
{ ' c-show' : this .open }
69
71
]
70
72
},
@@ -75,7 +77,7 @@ export default {
75
77
this .icon
76
78
)
77
79
} else {
78
- return { customClasses: [ this . icon , ' c-sidebar-nav-icon' ] }
80
+ return { customClasses: ' c-sidebar-nav-icon' , name : this . icon }
79
81
}
80
82
}
81
83
},
Original file line number Diff line number Diff line change 1
1
<template >
2
- <li class =" c-sidebar-nav-item" >
2
+ <li v-if = " inNavItem " class =" c-sidebar-nav-item" >
3
3
<CLink
4
4
:class =" linkClasses"
5
5
v-bind =" computedLinkProps"
17
17
</slot >
18
18
</CLink >
19
19
</li >
20
+ <CLink v-else >
21
+ <slot >
22
+ <CIcon v-if =" icon" v-bind =" computedIcon" />
23
+ <i v-if =" fontIcon" :class =" ['c-sidebar-nav-icon', fontIcon]" ></i >
24
+ {{name}}
25
+ <CBadge
26
+ v-if =" badge"
27
+ v-bind =" Object.assign({}, badge, { text: null })"
28
+ >
29
+ {{badge.text}}
30
+ </CBadge >
31
+ </slot >
32
+ </CLink >
20
33
</template >
21
34
22
35
<script >
23
36
import CLink , { props as linkProps } from ' ../link/CLink'
24
37
import CBadge from ' ../badge/CBadge'
25
- // import CIcon from '@coreui/icons/ vue'
38
+ import CIcon from ' @coreui/icons-vue/CIcon. vue'
26
39
27
40
const props = Object .assign (linkProps, {
28
41
name: String ,
29
42
icon: [String , Object ],
43
+ fontIcon: String ,
30
44
badge: Object ,
31
45
addLinkClasses: [String , Array , Object ],
32
- label: Boolean
46
+ label: Boolean ,
47
+ inNavItem: {
48
+ type: Boolean ,
49
+ default: true
50
+ }
33
51
})
34
52
35
53
export default {
36
54
name: ' CSidebarNavLink' ,
37
55
components: {
38
56
CLink,
39
57
CBadge,
40
- // CIcon
58
+ CIcon
41
59
},
42
60
props,
43
61
computed: {
@@ -66,7 +84,7 @@ export default {
66
84
this .icon
67
85
)
68
86
} else {
69
- return { customClasses: [ this . icon , ' c-sidebar-nav-icon' ] }
87
+ return { customClasses: ' c-sidebar-nav-icon' , name : this . icon }
70
88
}
71
89
}
72
90
},
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ describe(ComponentName, () => {
43
43
expect ( wrapper . vm . open ) . toBe ( true )
44
44
} )
45
45
it ( 'changes state when clicked on toggle' , ( ) => {
46
- wrapper . find ( '.c-sidebar-nav-link ' ) . trigger ( 'click' )
46
+ wrapper . find ( '.c-sidebar-nav-dropdown-toggle ' ) . trigger ( 'click' )
47
47
expect ( wrapper . vm . open ) . toBe ( false )
48
48
expect ( wrapper . emitted ( ) [ 'update:show' ] ) . toBeTruthy ( )
49
49
} )
Original file line number Diff line number Diff line change 2
2
3
3
exports [` CSidebarNavDropdown renders correctly 1` ] = `
4
4
<li
5
- class = " c-sidebar-nav-item c-sidebar-nav- dropdown"
5
+ class = " c-sidebar-nav-dropdown"
6
6
>
7
7
<a
8
- class = " c-sidebar-nav-link c-sidebar-nav- dropdown-toggle"
8
+ class = " c-sidebar-nav-dropdown-toggle"
9
9
>
10
- <cicon
11
- customclasses = " cui-settings,c-sidebar-nav-icon"
10
+ <svg
11
+ class = " c-sidebar-nav-icon"
12
+ viewBox = " 0 0 64 64"
13
+ xmlns = " http://www.w3.org/2000/svg"
12
14
/>
15
+
16
+ <!---->
13
17
14
18
15
19
Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ exports[`CSidebarNavLink.vue renders correctly 1`] = `
10
10
href = " #"
11
11
target = " _self"
12
12
>
13
- <cicon
14
- customclasses = " cui-settings,c-sidebar-nav-icon"
13
+ <svg
14
+ class = " c-sidebar-nav-icon"
15
+ viewBox = " 0 0 64 64"
16
+ xmlns = " http://www.w3.org/2000/svg"
15
17
/>
16
18
17
19
test link
@@ -37,8 +39,10 @@ exports[`CSidebarNavLink.vue renders correctly in label mode 1`] = `
37
39
href = " #"
38
40
target = " _self"
39
41
>
40
- <cicon
41
- customclasses = " cui-settings,c-sidebar-nav-icon"
42
+ <svg
43
+ class = " c-sidebar-nav-icon"
44
+ viewBox = " 0 0 64 64"
45
+ xmlns = " http://www.w3.org/2000/svg"
42
46
/>
43
47
44
48
test link
You can’t perform that action at this time.
0 commit comments