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

Custom rendered title in DataTable column header won't work well with CSV export #6542

Open
5 tasks done
Hilbrand opened this issue Nov 15, 2024 · 0 comments
Open
5 tasks done
Labels
untriaged need to sort

Comments

@Hilbrand
Copy link

Describe the bug

When using a function to render the title of a header in a DataTable with title(column) {} and than exporting this table as CSV file the column header in the CSV file will be the title function content instead of some plain text.

The link I put in the minimal reproduction points to the line of code that is related to this issue.

Steps to reproduce

  1. Construct a DataTable with custom header, like in example https://www.naiveui.com/en-US/os-theme/components/data-table#render-header
  2. Add export button, like in example: https://www.naiveui.com/en-US/os-theme/components/data-table#export-csv.vue
  3. Export the table.
  4. Header in CSV will be complete content of title function.

Link to minimal reproduction

const header = exportableColumns.map((col: any) => col.title).join(',')

System Info

Not relevant

Used Package Manager

npm

Validations

@Hilbrand Hilbrand added the untriaged need to sort label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

1 participant