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
44 lines (35 loc) · 1.06 KB
/
QTd.js
File metadata and controls
44 lines (35 loc) · 1.06 KB
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
import { h, computed, getCurrentInstance } from 'vue'
import { createComponent } from '../../utils/private/create.js'
import { hSlot } from '../../utils/private/render.js'
export default createComponent({
name: 'QTd',
props: {
props: Object,
autoWidth: Boolean,
noHover: Boolean
},
setup (props, { slots }) {
const vm = getCurrentInstance()
const classes = computed(() =>
'q-td' + (props.autoWidth === true ? ' q-table--col-auto-width' : '')
+ (props.noHover === true ? ' q-td--no-hover' : '')
+ ' '
)
return () => {
if (props.props === void 0) {
return h('td', { class: classes.value }, hSlot(slots.default))
}
const name = vm.vnode.key
const col = (
(props.props.colsMap !== void 0 ? props.props.colsMap[ name ] : null)
|| props.props.col
)
if (col === void 0) { return }
const { row } = props.props
return h('td', {
class: classes.value + col.__tdClass(row),
style: col.__tdStyle(row)
}, hSlot(slots.default))
}
}
})