Skip to content

Commit 02d5ffd

Browse files
committed
fix: CSidebarNavItem: fix icon computation
1 parent 8976054 commit 02d5ffd

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/components/template/CSidebarNavDropdown.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ export default {
7777
computedIcon () {
7878
if (typeof this.icon === 'object') {
7979
const key = this.icon.size ? 'class' : 'customClasses'
80-
return Object.assign(
81-
{ [`${key}`]: 'c-sidebar-nav-icon' },
82-
this.icon
83-
)
80+
return {
81+
...this.icon,
82+
[`${key}`]: this.icon.customClasses ||
83+
['c-sidebar-nav-icon', this.icon.className]
84+
}
8485
} else {
8586
return { customClasses: 'c-sidebar-nav-icon', name: this.icon }
8687
}

src/components/template/CSidebarNavItem.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ export default {
7373
computedIcon () {
7474
if (typeof this.icon === 'object') {
7575
const key = this.icon.size ? 'class' : 'customClasses'
76-
return Object.assign(
77-
{ [`${key}`]: 'c-sidebar-nav-icon' },
78-
this.icon
79-
)
76+
return {
77+
...this.icon,
78+
[`${key}`]: this.icon.customClasses ||
79+
['c-sidebar-nav-icon', this.icon.className]
80+
}
8081
} else {
8182
return { customClasses: 'c-sidebar-nav-icon', name: this.icon }
8283
}

0 commit comments

Comments
 (0)