oruga
oruga copied to clipboard
Can't reset the sorting of the table component
Oruga version: latest Vuejs version: latest
Description
In the vue2 version of Oruga, we could set the currently sorted column of a table by setting a reference to the <o-table /> component and mutating the prop currentSortColumn, eg.:
tableReference.value.currentSortColumn = {};
However, in the latest Oruga version (vue 3 / oruga 0.8.6), the <o-table /> component no longer exposes that prop, and the only prop remotely similar to that is the defaultSort, which is not two-way data bonded.
A two-way data bound prop or a method to change/reset the sorted column is desirable, as in our app we could reset the currently applied sorting, which now in the latest version no longer works.
@theonelucas Thanks to open this discussion. Fyi, we switched from 0.8 to the composition api. A component written with <script setup> are closed by default, so you can't access internal data attributes and function anymore like component written with the option api before.
However, I will have a look at how we can provide a way to update the surrentSortColumn programmatically.