File tree 6 files changed +28
-26
lines changed 6 files changed +28
-26
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,18 @@ export default {
16
16
default : () => []
17
17
}
18
18
},
19
+ computed: {
20
+ routeRecords : function () {
21
+ return this .list .filter ((route ) => route .name || route .meta .label )
22
+ }
23
+ },
19
24
methods: {
20
25
getName (item ) {
21
26
return item .meta && item .meta .label ? item .meta .label : item .name || null
22
27
},
23
28
isLast (index ) {
24
29
return index === this .list .length - 1
25
30
}
26
- },
27
- computed: {
28
- routeRecords : function () {
29
- return this .list .filter ((route ) => route .name || route .meta .label )
30
- }
31
31
}
32
32
}
33
33
</script >
Original file line number Diff line number Diff line change @@ -13,16 +13,16 @@ export default {
13
13
default: false
14
14
}
15
15
},
16
- mounted : function () {
17
- this .isFixed ()
18
- },
19
16
computed: {
20
17
classList () {
21
18
return [
22
19
' app-footer'
23
20
]
24
21
}
25
22
},
23
+ mounted : function () {
24
+ this .isFixed ()
25
+ },
26
26
methods: {
27
27
isFixed () {
28
28
this .fixed ? document .body .classList .add (' footer-fixed' ) : document .body .classList .remove (' footer-fixed' )
Original file line number Diff line number Diff line change @@ -57,13 +57,6 @@ import VuePerfectScrollbar from 'vue-perfect-scrollbar'
57
57
58
58
export default {
59
59
name: ' SidebarNav' ,
60
- props: {
61
- navItems: {
62
- type: Array ,
63
- required: true ,
64
- default : () => []
65
- }
66
- },
67
60
components: {
68
61
SidebarNavDivider,
69
62
SidebarNavDropdown,
@@ -73,6 +66,13 @@ export default {
73
66
SidebarNavLabel,
74
67
VuePerfectScrollbar
75
68
},
69
+ props: {
70
+ navItems: {
71
+ type: Array ,
72
+ required: true ,
73
+ default : () => []
74
+ }
75
+ },
76
76
data () {
77
77
return {}
78
78
},
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default {
7
7
name: ' sidebar-nav-divider' ,
8
8
props: {
9
9
classes: {
10
- type: String ,
10
+ type: [ String , Array , Object ] ,
11
11
default: ' '
12
12
}
13
13
},
@@ -19,7 +19,8 @@ export default {
19
19
]
20
20
},
21
21
itemClasses () {
22
- return this .classes ? this .classes .split (' ' ) : ' '
22
+ const classes = this .classes
23
+ return ! classes ? [] : typeof classes === ' string' || classes instanceof String ? classes .split (' ' ) : Array .isArray (classes) ? classes : Object .keys (classes).filter (i => classes[i])
23
24
}
24
25
}
25
26
}
Original file line number Diff line number Diff line change 7
7
:required =" required"
8
8
:name =" name"
9
9
:value =" value"
10
- @change =" handleChange"
11
10
class =" switch-input form-check-input"
12
11
type =" checkbox"
13
12
true-value =" value"
14
13
false-value =" uncheckedValue"
14
+ @change =" handleChange"
15
15
>
16
16
<template v-if =" label " >
17
17
<span
@@ -32,11 +32,6 @@ export default {
32
32
prop: ' modelChecked' ,
33
33
event : ' change'
34
34
},
35
- data : function () {
36
- return {
37
- checkedData: this .isChecked ? this .value : this .uncheckedValue
38
- }
39
- },
40
35
props: {
41
36
id: {
42
37
type: String ,
@@ -108,6 +103,11 @@ export default {
108
103
default: ' Off'
109
104
}
110
105
},
106
+ data : function () {
107
+ return {
108
+ checkedData: this .isChecked ? this .value : this .uncheckedValue
109
+ }
110
+ },
111
111
computed: {
112
112
classList () {
113
113
return [
@@ -126,6 +126,9 @@ export default {
126
126
return this .modelChecked === this .value
127
127
}
128
128
},
129
+ mounted () {
130
+ this .toggle (this .defaultChecked || this .checked || this .isChecked );
131
+ },
129
132
methods: {
130
133
handleChange (event ) {
131
134
this .toggle (event .target .checked );
@@ -135,8 +138,5 @@ export default {
135
138
this .$emit (' change' , this .checkedData );
136
139
}
137
140
},
138
- mounted () {
139
- this .toggle (this .defaultChecked || this .checked || this .isChecked );
140
- },
141
141
}
142
142
</script >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ exports[`SidebarNavLabel.vue renders correctly 1`] = `
12
12
class = " fa fa-circle text-info "
13
13
/>
14
14
15
+
15
16
</a >
16
17
</li >
17
18
` ;
You can’t perform that action at this time.
0 commit comments