Skip to content

Commit 1ef33e2

Browse files
committed
feat(QTabs/QTab): New prop -> content-class quasarframework#6995
1 parent 5baaa41 commit 1ef33e2

File tree

6 files changed

+39
-16
lines changed

6 files changed

+39
-16
lines changed

ui/src/components/tabs/QTab.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default Vue.extend({
4242

4343
tabindex: [String, Number],
4444
disable: Boolean,
45-
45+
4646
contentClass: String
4747
},
4848

@@ -63,6 +63,11 @@ export default Vue.extend({
6363
}
6464
},
6565

66+
innerClass () {
67+
return (this.tabs.inlineLabel === true ? 'row no-wrap q-tab__content--inline' : 'column') +
68+
(this.contentClass !== void 0 ? ` ${this.contentClass}` : '')
69+
},
70+
6671
computedTabIndex () {
6772
return this.disable === true || this.isActive === true ? -1 : this.tabindex || 0
6873
},
@@ -153,7 +158,7 @@ export default Vue.extend({
153158

154159
h('div', {
155160
staticClass: 'q-tab__content self-stretch flex-center relative-position q-anchor--skip non-selectable',
156-
class: [this.tabs.inlineLabel === true ? 'row no-wrap q-tab__content--inline' : 'column', this.contentClass].join(' ')
161+
class: this.innerClass
157162
}, mergeSlot(content, this, 'default'))
158163
]
159164

ui/src/components/tabs/QTab.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
"category": "content"
5858
},
5959

60+
"content-class": {
61+
"type": "String",
62+
"desc": "Class definitions to be attributed to the content wrapper",
63+
"examples": [ "my-special-class" ],
64+
"category": "style",
65+
"addedIn": "v1.12.0"
66+
},
67+
6068
"tabindex": {
6169
"extends": "tabindex"
6270
},

ui/src/components/tabs/QTabs.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default Vue.extend({
8787
noCaps: Boolean,
8888

8989
dense: Boolean,
90-
90+
9191
contentClass: String
9292
},
9393

@@ -168,6 +168,10 @@ export default Vue.extend({
168168
(this.stretch === true ? ' self-stretch' : '')
169169
},
170170

171+
innerClass () {
172+
return this.alignClass + (this.contentClass !== void 0 ? ` ${this.contentClass}` : '')
173+
},
174+
171175
domProps () {
172176
return this.vertical === true
173177
? { container: 'height', content: 'scrollHeight', posLeft: 'top', posRight: 'bottom' }
@@ -399,7 +403,7 @@ export default Vue.extend({
399403
h('div', {
400404
ref: 'content',
401405
staticClass: 'q-tabs__content row no-wrap items-center self-stretch hide-scrollbar',
402-
class: [this.alignClass, this.contentClass].join(' ')
406+
class: this.innerClass
403407
}, slot(this, 'default'))
404408
]
405409

ui/src/components/tabs/QTabs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
"category": "style"
5757
},
5858

59+
"content-class": {
60+
"type": "String",
61+
"desc": "Class definitions to be attributed to the content wrapper",
62+
"examples": [ "my-special-class" ],
63+
"category": "style",
64+
"addedIn": "v1.12.0"
65+
},
66+
5967
"left-icon": {
6068
"type": "String",
6169
"desc": "The name of an icon to replace the default arrow used to scroll through the tabs to the left, when the tabs extend past the width of the tabs container",

ui/src/components/tabs/QTabs.sass

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,13 @@
166166
&--full
167167
min-height: 52px
168168

169-
body.mobile
170-
.q-tabs
169+
body.mobile .q-tabs
171170

172-
&__content
173-
overflow: auto
171+
&__content
172+
overflow: auto
174173

175-
&__arrow
176-
display: none
174+
&__arrow
175+
display: none
177176

178177
@media (min-width: $breakpoint-lg-min)
179178
.q-header, .q-footer

ui/src/components/tabs/QTabs.styl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,13 @@
166166
&--full
167167
min-height: 52px
168168

169-
body.mobile
170-
.q-tabs
169+
body.mobile .q-tabs
171170

172-
&__content
173-
overflow: auto
171+
&__content
172+
overflow: auto
174173

175-
&__arrow
176-
display: none
174+
&__arrow
175+
display: none
177176

178177
@media (min-width: $breakpoint-lg-min)
179178
.q-header, .q-footer

0 commit comments

Comments
 (0)