Skip to content

Commit

Permalink
Merge pull request #934 from 3YOURMIND/fix-scoped-slots-in-table
Browse files Browse the repository at this point in the history
fix(KtTable): reinstate $scopedSlot as they are needed in [email protected]
  • Loading branch information
Isokaeder authored Jun 6, 2024
2 parents 82f1009 + 575f61c commit 4316184
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-config/source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export default {
'vue/jsx-uses-vars': 'error',
'vue/no-deprecated-data-object-declaration': 'error',
'vue/no-deprecated-destroyed-lifecycle': 'error',
'vue/no-deprecated-dollar-scopedslots-api': 'error',
// 'vue/no-deprecated-dollar-scopedslots-api': 'error', -- FIXME: reactivate with Vue@3
'vue/no-deprecated-events-api': 'error',
'vue/no-deprecated-filter': 'error',
'vue/no-deprecated-functional-template': 'error',
Expand Down
10 changes: 6 additions & 4 deletions packages/kotti-ui/source/kotti-table/KtTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,25 +205,27 @@ export default {
return colSpan
},
isExpandable() {
return Boolean(this.$slots.expand || this.renderExpand)
return Boolean(this.$scopedSlots.expand || this.renderExpand)
},
hasActions() {
return Boolean(this.$slots.actions || this.renderActions)
return Boolean(this.$scopedSlots.actions || this.renderActions)
},
_renderExpand() {
return (h: CreateElement, rowData: any) => {
if (this.renderExpand) return this.renderExpand(h, rowData)
// @ts-expect-error $slots will exist at runtime
return this.$slots.expand(rowData)
return this.$scopedSlots.expand(rowData)
}
},
_renderActions() {
return (h: CreateElement, rowData: any) => {
if (this.renderActions) return this.renderActions(h, rowData)
// @ts-expect-error $slots will exist at runtime
return this.$slots.actions(rowData)
return this.$scopedSlots.actions(rowData)
}
},
_renderLoading() {
Expand Down

0 comments on commit 4316184

Please sign in to comment.