Created
January 10, 2019 19:45
-
-
Save hamiltongabriel/4577966821b5978d35983cb41dc29aaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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