forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQTd.js
More file actions
51 lines (38 loc) · 1012 Bytes
/
QTd.js
File metadata and controls
51 lines (38 loc) · 1012 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
43
44
45
46
47
48
49
50
51
import Vue from 'vue'
import ListenersMixin from '../../mixins/listeners.js'
import { slot } from '../../utils/slot.js'
export default Vue.extend({
name: 'QTd',
mixins: [ ListenersMixin ],
props: {
props: Object,
autoWidth: Boolean,
noHover: Boolean
},
computed: {
classes () {
return 'q-td' + (this.autoWidth === true ? ' q-table--col-auto-width' : '') +
(this.noHover === true ? ' q-td--no-hover' : '') + ' '
}
},
render (h) {
const on = this.qListeners
if (this.props === void 0) {
return h('td', {
on,
class: this.classes
}, slot(this, 'default'))
}
const name = this.$vnode.key
const col = this.props.colsMap !== void 0 && name
? this.props.colsMap[name]
: this.props.col
if (col === void 0) { return }
const row = this.props.row
return h('td', {
on,
style: col.__tdStyle(row),
class: this.classes + col.__tdClass(row)
}, slot(this, 'default'))
}
})