fix(components): [table] selected data not sync after change sort

This commit is contained in:
btea 2024-12-29 11:01:34 +08:00
parent 7d76dea667
commit b75a07892e

View File

@ -217,6 +217,13 @@ function useWatcher<T>() {
)
selection.value = newSelection
instance.emit('selection-change', newSelection.slice())
} else {
const hasSortChanged = selection.value.some(
(item, index) => item !== data.value[index]
)
if (hasSortChanged) {
selection.value = data.value.slice()
}
}
}