Skip to content
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

n-data-table slot for row or component for column #5065

Closed
Satont opened this issue Jul 15, 2023 · 5 comments
Closed

n-data-table slot for row or component for column #5065

Satont opened this issue Jul 15, 2023 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@Satont
Copy link

Satont commented Jul 15, 2023

This function solves the problem (这个功能解决的问题)

Hi, i feel a bit frustrating with working on datatable.

My issue is i often need custom render for columns, and doing layout via h function is a bit pain.

Expected API (期望的 API)

I see two ways there:

  1. We can create new component called n-data-table-column for usage in vue <template>. In that case it should take column name from property for example called column="name".
    If we not create n-data-table-column for other columns, they use default render from :columns property of n-data-table

  2. Also this issue can be done via fully custom row customization, so we have component n-data-table-row, but in that case we should write all columns render here, which is might be overhead.

@github-actions github-actions bot added the feature request New feature or request label Jul 15, 2023
@fudiwei
Copy link

fudiwei commented Aug 21, 2023

It seems that the official team is not planning to do this work. 😭

I created a project @skit/x.naive-ui based on Naive-UI, enables to use DataTable in template style. Welcome to improve it.


For example like this:

<x-n-data-table :data="data">
  <x-n-data-table-column type="selection" />
  <x-n-data-table-column key="name" title="Name" />
  <x-n-data-table-column key="age" title="Age" />
  <x-n-data-table-column key="address" title="Address" />
</x-n-data-table>

@jahnli jahnli added duplicate This issue or pull request already exists and removed feature request New feature or request labels Dec 29, 2023
@jahnli
Copy link
Collaborator

jahnli commented Dec 29, 2023

duplicate #4273

@jahnli jahnli closed this as completed Dec 29, 2023
@Satont
Copy link
Author

Satont commented Dec 29, 2023

@fudiwei thank! Appreciate translate to english.

@Satont
Copy link
Author

Satont commented Dec 29, 2023

@jahnli didn't know abotu that issues, since i'm not chinese speaker. Thanks.

@jahnli
Copy link
Collaborator

jahnli commented Dec 30, 2023

There is a community that has created a Naive UI based project @skit/x.naive-uiDataTable that can be used in template styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants