T
T
thehighhomie2018-11-10 15:39:22
Vue.js
thehighhomie, 2018-11-10 15:39:22

VueJS & fabric.js: how to achieve reactivity?

I added the fabric.js library to VueJS and initialized it in the AppCanvas component, in the mounted hook.
Added "Add element" button for adding test.
Finished the "elems" state and the "addElems" mutation in Vuex and used them in the component, but there is no reactivity - the mutation itself is processed, but the cycle in the mounted hook is not updated, that is, the elements are not added.
The same thing happens if I use props instead of storage.
Here is the sandbox
Please tell me how to achieve reactivity?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Varyukhin, 2018-11-10
@thehighhomie

If I understand correctly, you forgot to redraw the canvas. (For watch: elements), for example)
Upd: No, I didn't see that. Wait a minute.
So everything works)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question