Skip to content

Commit df4b43e

Browse files
committed
feat: CNav: add inCard prop
1 parent 445153b commit df4b43e

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/components/Nav/CNav.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@ export default {
1212
justified: Boolean,
1313
tabs: Boolean,
1414
pills: Boolean,
15-
vertical: Boolean
15+
vertical: Boolean,
16+
inCard: Boolean
1617
},
1718
computed: {
1819
navClasses () {
20+
const hasTabs = this.tabs && !this.pills
1921
return {
2022
'nav' : true,
21-
'nav-tabs': this.tabs && !this.pills,
23+
'nav-tabs': hasTabs,
2224
'nav-pills': this.pills,
2325
'flex-column': this.vertical,
2426
'nav-fill': this.fill,
25-
'nav-justified': this.justified
27+
'nav-justified': this.justified,
28+
'card-header-tabs': this.inCard && hasTabs,
29+
'card-header-pills': this.inCard && this.pills
2630
}
2731
}
2832
},

src/components/Nav/tests/CNav.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const customWrapper = mount(Component, {
2222
fill: true,
2323
justified: true,
2424
pills: true,
25-
vertical: true
25+
vertical: true,
26+
inCard: true
2627
},
2728
slots: {
2829
default: [CNavItem, CNavItem, CNavItem, CNavItem]

src/components/Nav/tests/__snapshots__/CNav.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`CNav renders correctly 1`] = `
1010

1111
exports[`CNav renders correctly 2`] = `
1212
<ul
13-
class="nav nav-pills flex-column nav-fill nav-justified"
13+
class="nav nav-pills flex-column nav-fill nav-justified card-header-pills"
1414
>
1515
<li
1616
class="nav-item"

src/components/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ export declare class CNav extends Vue {
392392
tabs: boolean
393393
pills: boolean
394394
vertical: boolean
395+
inCard: boolean
395396
}
396397

397398
export declare class CNavItem extends CLink {}

0 commit comments

Comments
 (0)