B
B
bozuriciyu2019-08-22 22:58:44
Vue.js
bozuriciyu, 2019-08-22 22:58:44

How to reactively move an element in an array from a child component?

There is an editor component. Consists of blocks of content. Each block is an element of the content array. There are buttons for adding a block. How to make up and down buttons, and delete an element? Those. changing the position of an element in the array, observing the approximate structure of the components, as in the example here? At the same time without killing reactivity?
https://codesandbox.io/s/vue-template-k0dbr

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-08-22
@bozuriciyu

Copy the array, swap the elements, send it to the parent. For example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question