I have a page with multiple (dynamic) tables, where every table has selections.
I tried to approach this as follows:
dynamically set items-selected: v-model:items-selected="selection[index]">
with selection being letselection: Ref<Item[]>[] = [];
And filling it (I tried multiple ways, none seemed to make a difference):
selection = Array(amountOfTables).fill(ref<Item[]>([]))
In principle I see no difference with the example: selection[index] refers to a ref<Item[]>([]) as the documentation specifies. It does not work though. The reactivity is broken.
Is this just not possible, or is some other setup needed to make this work?
Workaround:
Use one variable for selections in all tables. If your tables hasduplicate values, add something unique like an id (items-selected works with the json-representation to see if an item is the same). Note that this doesn't work great: e.g. the select-all button will delete all selections of other tables.
I have a page with multiple (dynamic) tables, where every table has selections.
I tried to approach this as follows: dynamically set items-selected:
v-model:items-selected="selection[index]">
withselection
beingletselection: Ref<Item[]>[] = [];
And filling it (I tried multiple ways, none seemed to make a difference):selection = Array(amountOfTables).fill(ref<Item[]>([]))
In principle I see no difference with the example:
selection[index]
refers to aref<Item[]>([])
as the documentation specifies. It does not work though. The reactivity is broken.Is this just not possible, or is some other setup needed to make this work?
Workaround: Use one variable for selections in all tables. If your tables hasduplicate values, add something unique like an id (
items-selected
works with the json-representation to see if an item is the same). Note that this doesn't work great: e.g. the select-all button will delete all selections of other tables.