tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.08k stars 1.67k forks source link

Data Table: let configure the sort order globally #4613

Closed edimitchel closed 7 months ago

edimitchel commented 1 year ago

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

I'm trying Naive UI in confrontation with PrimeNG/PrimeVue. I'm search a way for changing the order of sort on sortable column click. Their datatables choose the sort order as "ascend" then "descend". Naive UI's datatable is using "descend" then "ascend".

Don't find a solution to change the order without manipulating sort state (I took a look into config provider but was annoyed to see the only config is the current state aplied).

I would like to configure the data table with an array (with as default the current value) and let anyone change it using config provider another value, and why not, with different values than 'ascend' or 'descend'.

Expected API (期望的 API)

jahnli commented 7 months ago

This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem