M
M
MeMoJlor2021-09-25 22:49:45
Vue.js
MeMoJlor, 2021-09-25 22:49:45

How to remove Vuex reactivity?

I make todo list: LINK .
The functionality is already ready, but I decided to complicate and add the ability to change.

The logic is this: by double-clicking, it becomes possible to change the text of the case where the double-click was made. The text in the repository changes after clicking on the "save change" button.

Everything would be fine, but now by double-clicking it becomes possible to change the text of all cases, and when changing, due to reactivity, the text changes immediately.

Is it possible to remove reactivity and pointwise change the text of the case, without adding new keys to the store?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-09-25
@MeMoJlor

You don't need it.
The component that is engaged in editing - let it create a copy of the edited data inside itself, and work with the copy. And by pressing the save button, this copy is transferred to the mutation, where the values ​​of its properties will be written to the original object. Somehow so .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question