Skip to content

Commit f0db2df

Browse files
committed
refactor: CTabs: merge 'pills' and 'tabs' props to 'variant' prop
1 parent 0de828b commit f0db2df

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/components/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@ export declare class CDataTable extends Vue {
579579
export declare class CTabs extends Vue {
580580
fill: boolean
581581
justified: boolean
582-
pills: boolean
583-
tabs: boolean
582+
variant: string
584583
fade: boolean
585584
vertical: [boolean, object]
586585
addNavWrapperClasses: [string, Array<any>, object]

src/components/tabs/CTabs.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export default {
4848
props: {
4949
fill: Boolean,
5050
justified: Boolean,
51-
pills: Boolean,
52-
tabs: {
53-
type: Boolean,
54-
default: true
51+
variant: {
52+
type: String,
53+
default: 'tabs',
54+
validator: val => ['', 'tabs', 'pills'].includes(val)
5555
},
5656
fade: {
5757
type: Boolean,
@@ -81,9 +81,9 @@ export default {
8181
return [
8282
this.addNavClasses,
8383
{
84-
'nav' : true,
85-
'nav-tabs': this.tabs && !this.pills,
86-
'nav-pills': this.pills,
84+
'nav': true,
85+
'nav-tabs': this.variant === 'tabs',
86+
'nav-pills': this.variant === 'pills',
8787
'flex-column': this.vertical,
8888
'nav-fill': this.fill,
8989
'nav-justified': this.justified,

src/components/tabs/tests/CTabs.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const defaultWrapper = mount(CTabs)
1010
// propsData: {
1111
// fill: true,
1212
// justified: true,
13-
// pills: true,
13+
// variant: 'pills',
1414
// fade: true,
1515
// vertical: true,
1616
// addNavWrapperClasses: 'additional-nav-wrapper-class',
@@ -33,7 +33,7 @@ const App = Vue.extend({
3333
props: {
3434
fill: true,
3535
justified: true,
36-
pills: true,
36+
variant: 'pills',
3737
fade: true,
3838
vertical: { navs: 'col-sm-3', content: 'col-sm-9' },
3939
addNavWrapperClasses: 'additional-nav-wrapper-class',

0 commit comments

Comments
 (0)