Skip to content

Commit 39596d5

Browse files
committed
fix: CSidebarNavItem: change default active link class
1 parent a37d685 commit 39596d5

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

src/components/sidebar/CSidebarNavItem.vue

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,28 @@ import CLink, { props as linkProps } from '../link/CLink'
2525
import CBadge from '../badge/CBadge'
2626
import CIcon from '@coreui/icons-vue/CIcon.vue'
2727
28-
const props = Object.assign({}, linkProps, {
29-
name: String,
30-
icon: [String, Object],
31-
fontIcon: String,
32-
badge: Object,
33-
addLinkClasses: [String, Array, Object],
34-
label: Boolean
35-
})
28+
const props = Object.assign(
29+
{},
30+
linkProps,
31+
{
32+
exact: {
33+
type: Boolean,
34+
default: true
35+
},
36+
activeClass: {
37+
type: String,
38+
default: 'c-active'
39+
}
40+
},
41+
{
42+
name: String,
43+
icon: [String, Object],
44+
fontIcon: String,
45+
badge: Object,
46+
addLinkClasses: [String, Array, Object],
47+
label: Boolean
48+
}
49+
)
3650
3751
export default {
3852
name: 'CSidebarNavItem',
@@ -43,18 +57,12 @@ export default {
4357
},
4458
props,
4559
computed: {
46-
linkProps () {
60+
computedLinkProps () {
4761
return Object.keys(linkProps).reduce((props, key) => {
4862
props[key] = this[key]
4963
return props
5064
}, {})
5165
},
52-
addedLinkProps () {
53-
return this.$options.propsData.exact === undefined ? { exact: true } : {}
54-
},
55-
computedLinkProps () {
56-
return Object.assign(this.linkProps, this.addedLinkProps)
57-
},
5866
linkClasses () {
5967
return [
6068
this.label ? 'c-sidebar-nav-label' : 'c-sidebar-nav-link',

0 commit comments

Comments
 (0)