Occationally you want to force some part of your Vue application to update. One situation is that I have a “big” web application not written in Vue, and somewhere I add a Vue component. Something in the world around it changes but it is not aware of it, so I want to force it to update.
It seems, the vm.$forceUpdate method is just updating the component itself, and children with slots. I didn’t use slots, and $forceUpdate was useless.
So, if you do myVue.$forceUpdate() without success, try:
myVue.$children.forEach(c => c.$forceUpdate());
It might do what you want. It did for me.
0 Comments.