forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQBtnGroup.js
More file actions
39 lines (32 loc) · 857 Bytes
/
QBtnGroup.js
File metadata and controls
39 lines (32 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Vue from 'vue'
import ListenersMixin from '../../mixins/listeners.js'
import { slot } from '../../utils/slot.js'
export default Vue.extend({
name: 'QBtnGroup',
mixin: [ ListenersMixin ],
props: {
unelevated: Boolean,
outline: Boolean,
flat: Boolean,
rounded: Boolean,
push: Boolean,
stretch: Boolean,
glossy: Boolean,
spread: Boolean
},
computed: {
classes () {
return ['unelevated', 'outline', 'flat', 'rounded', 'push', 'stretch', 'glossy']
.filter(t => this[t] === true)
.map(t => `q-btn-group--${t}`).join(' ')
}
},
render (h) {
return h('div', {
staticClass: 'q-btn-group row no-wrap ' +
(this.spread === true ? 'q-btn-group--spread' : 'inline'),
class: this.classes,
on: { ...this.qListeners }
}, slot(this, 'default'))
}
})