Skip to content

Commit

Permalink
fix(VDataTable): enable use of expanded-item slot when using item slot
Browse files Browse the repository at this point in the history
  • Loading branch information
nekosaur committed Jun 15, 2019
1 parent 6e15405 commit a98dde5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/vuetify/src/components/VDataTable/VDataTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,17 @@ export default VDataIterator.extend({
return this.$scopedSlots.item ? this.genScopedRows(items, props) : this.genDefaultRows(items, props)
},
genScopedRows (items: any[], props: DataProps) {
return items.map((item: any) => this.$scopedSlots.item!(this.createItemProps(item)))
const rows = []

for (let i = 0; i < items.length; i++) {
const item = items[i]
rows.push(this.$scopedSlots.item!(this.createItemProps(item)))
if (this.isExpanded(item)) {
rows.push(this.$scopedSlots['expanded-item']!({ item, headers: this.computedHeaders }))
}
}

return rows
},
genDefaultRows (items: any[], props: DataProps) {
return this.$scopedSlots['expanded-item']
Expand Down

0 comments on commit a98dde5

Please sign in to comment.