mirror of
https://github.com/crater-invoice/crater.git
synced 2026-02-08 03:42:41 -05:00
init crater
This commit is contained in:
24
resources/assets/js/components/base/base-table/components/TableCell.js
Executable file
24
resources/assets/js/components/base/base-table/components/TableCell.js
Executable file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
functional: true,
|
||||
|
||||
props: ['column', 'row', 'responsiveLabel'],
|
||||
|
||||
render (createElement, { props }) {
|
||||
const data = {}
|
||||
|
||||
if (props.column.cellClass) {
|
||||
data.class = props.column.cellClass
|
||||
}
|
||||
|
||||
if (props.column.template) {
|
||||
return createElement('td', data, props.column.template(props.row.data))
|
||||
}
|
||||
|
||||
data.domProps = {}
|
||||
data.domProps.innerHTML = props.column.formatter(props.row.getValue(props.column.show), props.row.data)
|
||||
|
||||
return createElement('td', [
|
||||
createElement('span', props.responsiveLabel), data.domProps.innerHTML
|
||||
])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user