There was an error while loading. Please reload this page.
1 parent bae7f3f commit 68124deCopy full SHA for 68124de
src/runtime/components/data/Table.vue
@@ -326,15 +326,18 @@ export default defineComponent({
326
}
327
328
function selectAllRows () {
329
+ // Create a new array to ensure reactivity
330
+ const newSelected = [...selected.value]
331
+
332
+ // If the row is not already selected, add it to the newSelected array
333
props.rows.forEach((row) => {
- // If the row is already selected, don't select it again
- if (isSelected(row)) {
- return
334
+ if (!isSelected(row)) {
335
+ newSelected.push(row)
336
-
- // @ts-ignore
- selected.value.push(row)
337
})
338
339
+ // Reassign the array to trigger Vue's reactivity
340
+ selected.value = newSelected
341
342
343
function onChange (checked: boolean) {
0 commit comments