-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table support slot for customColumn #106
Comments
Dynamic slot name is not a good pattern since it's very unfriendly to typescript. Personally I don't think this is a good API. Currently vue's slot has no type but if some time later it supports it, the API will cause chaos. The case you provide is not convicing since it doesn't show template slot is much easier than render function. If you could provide some more convincing examples, I will reopen the issue. |
Since Vue 3.3 now supports typed Slots with |
If you want to use other components in the cell template or / and use template directives, it would be much easier to use with having slots available. |
I created a project @skit/x.naive-ui based on Naive-UI, enables to use DataTable in template style. Welcome to improve it. For the scenario proposed by OP, it can be written as: <x-n-data-table :columns="columns" :data="data">
<template #renderCell="{ column, rowData, value }">
<span>{{ column.title }} {{ value }} Custom things</span>
</template>
</x-n-data-table> |
What problem does the feature solve?
we can custom column in template with slot
What does the proposed API look like?
Some pictures that can demonstrate the feature.
The text was updated successfully, but these errors were encountered: