Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3bb6c1f

Browse filesBrowse files
committed
feat: CSidebarNavItem: add color prop
1 parent 833d98a commit 3bb6c1f
Copy full SHA for 3bb6c1f

File tree

Expand file treeCollapse file tree

4 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-3
lines changed

‎src/components/index.d.ts

Copy file name to clipboardExpand all lines: src/components/index.d.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ export declare class CSidebarNavItem extends CLink {
539539
badge?: object
540540
addLinkClasses?: string
541541
label?: boolean
542+
color?: string
542543
}
543544

544545
export declare class CSidebarNavTitle extends Vue {}

‎src/components/template/CSidebarNavItem.vue

Copy file name to clipboardExpand all lines: src/components/template/CSidebarNavItem.vue
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ const props = Object.assign(
4343
fontIcon: String,
4444
badge: Object,
4545
addLinkClasses: [String, Array, Object],
46-
label: Boolean
46+
label: Boolean,
47+
color: String
4748
}
4849
)
4950
@@ -65,6 +66,7 @@ export default {
6566
linkClasses () {
6667
return [
6768
this.label ? 'c-sidebar-nav-label' : 'c-sidebar-nav-link',
69+
this.color && `c-sidebar-nav-link-${this.color}`,
6870
this.addLinkClasses
6971
]
7072
},

‎src/components/template/tests/CSidebarNavItem.spec.js

Copy file name to clipboardExpand all lines: src/components/template/tests/CSidebarNavItem.spec.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const wrapper = mount(Component, {
1010
badge: {
1111
color: 'success',
1212
text: 'NEW'
13-
}
13+
},
14+
color: 'success'
1415
},
1516
attrs: {
1617
id: 'link'

‎src/components/template/tests/__snapshots__/CSidebarNavItem.spec.js.snap

Copy file name to clipboardExpand all lines: src/components/template/tests/__snapshots__/CSidebarNavItem.spec.js.snap
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`CSidebarNavItem.vue renders correctly 1`] = `
66
id="link"
77
>
88
<a
9-
class="c-sidebar-nav-link"
9+
class="c-sidebar-nav-link c-sidebar-nav-link-success"
1010
href="#"
1111
target="_self"
1212
>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.