forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQTableColumns.js
More file actions
42 lines (41 loc) · 857 Bytes
/
QTableColumns.js
File metadata and controls
42 lines (41 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
40
41
42
import { QSelect } from '../select'
export default {
name: 'QTableColumns',
props: {
value: {
type: Array,
required: true
},
label: String,
columns: {
type: Array,
required: true
},
color: String
},
computed: {
computedOptions () {
return this.columns.filter(col => !col.required).map(col => ({
value: col.name,
label: col.label
}))
}
},
render (h) {
return h(QSelect, {
props: {
multiple: true,
toggle: true,
value: this.value,
options: this.computedOptions,
displayValue: this.label || this.$q.i18n.table.columns,
color: this.color,
hideUnderline: true
},
on: {
input: v => { this.$emit('input', v) },
change: v => { this.$emit('change', v) }
}
})
}
}