Skip to content

Instantly share code, notes, and snippets.

@hamiltongabriel
Created January 10, 2019 19:45
Show Gist options
  • Select an option

  • Save hamiltongabriel/4577966821b5978d35983cb41dc29aaa to your computer and use it in GitHub Desktop.

Select an option

Save hamiltongabriel/4577966821b5978d35983cb41dc29aaa to your computer and use it in GitHub Desktop.
import { QTable } from 'quasar'
export default {
extends: QTable,
name: 'AppTable',
methods: {
getTableBody (h) {
debugger
const
body = this.$scopedSlots.body,
topRow = this.$scopedSlots['top-row'],
bottomRow = this.$scopedSlots['bottom-row']
let child = []
child = this.computedRows.map(row => {
const
key = row[this.rowKey],
selected = this.isRowSelected(key)
return body(this.addBodyRowMeta({
key,
row,
cols: this.computedCols,
colsMap: this.computedColsMap,
__trClass: selected ? 'selected' : ''
}))
})
if (topRow) {
debugger
child.unshift(topRow({cols: this.computedCols}))
}
if (bottomRow) {
debugger
child.push(bottomRow({cols: this.computedCols}))
}
return h('tbody', { class: 'cursor-pointer' }, child)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment