Can you force Vue.js to reload/re-render?

Dave picture Dave · Aug 19, 2015 · Viewed 321.1k times · Source

Just a quick question.

Can you force Vue.js to reload/recalculate everything? If so, how?

Answer

Boris Mossounov picture Boris Mossounov · Nov 14, 2016

Try this magic spell:

vm.$forceUpdate();

No need to create any hanging vars :)

Update: I found this solution when I only started working with VueJS. However further exploration proved this approach as a crutch. As far as I recall, in a while I got rid of it simply putting all the properties that failed to refresh automatically (mostly nested ones) into computed properties.

More info here: https://vuejs.org/v2/guide/computed.html