A
A
Andrey Getmanov2019-12-23 16:35:24
Vue.js
Andrey Getmanov, 2019-12-23 16:35:24

How to recreate a component in NUXT?

Good afternoon.
Let me know if I'm doing it wrong.
I have a slider in which all slides change with a toggle.
The slider data is stored in the store, when using the switch, the dom is rendered, but the slider is not created.
Normally works only at the first rendering.
The question is how to recreate the component so that mounted is launched in it? Or how to run mounted from the parent?
Create component with $createElement failed
glidejs slider plugin
Example https://github.com/Ceyl0n/toggleSlider

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Levchenko, 2020-01-06
@nuykon

https://vuejs.org/v2/api/#vm-watch
https://vuejs.org/v2/api/#vm-forceUpdate
But I usually just give the component a key and change it when I need to force the component to rerender
<my-component :key="compKey" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question