T
T
Tash1moto2018-11-13 01:21:11
JavaScript
Tash1moto, 2018-11-13 01:21:11

How to insert an element in the center of a Vuex array?

Hello.
I have a vue table using vuex.
It is necessary to add a column to the table (in the middle, for example), but so that the table would completely re-render the indexes, because I use indexes.
in mutation I call

state.cols.splice(toIndex,0,payload.newColumnContent)

the column is added, but the indexes are shifted and my table breaks.
it is necessary to re-render the table when adding. or to force to recalculate indexes. How to do it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question