Fixed #137 - The slot #empty of DataTable not working

pull/146/head
cagataycivici 2020-01-10 15:14:07 +03:00
parent d254027ef3
commit b5f06bf527
1 changed files with 17 additions and 2 deletions

View File

@ -36,7 +36,7 @@
</template> </template>
<tr v-else class="p-datatable-emptymessage"> <tr v-else class="p-datatable-emptymessage">
<td :colspan="columns.length"> <td :colspan="columns.length">
<slot name="empty"></slot> <DTEmptySlotTemplate :template="templates.empty" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -75,6 +75,20 @@ const RowExpansionTemplate = {
} }
} }
const EmptySlotTemplate = {
functional: true,
props: {
template: {
type: null,
default: null
}
},
render(createElement, context) {
const content = context.props.template();
return [content];
}
}
export default { export default {
props: { props: {
value: { value: {
@ -420,7 +434,8 @@ export default {
}, },
components: { components: {
'DTBodyCell': BodyCell, 'DTBodyCell': BodyCell,
'DTRowExpansionTemplate': RowExpansionTemplate 'DTRowExpansionTemplate': RowExpansionTemplate,
'DTEmptySlotTemplate': EmptySlotTemplate
} }
} }
</script> </script>