I read the docs, but I can\'t understand it. I know what data, computed, watch, methods do but what is nextTick() use for in vuejs?
To make Pranshat's answer about the difference between using nextTick and setTimeout, more explicit, I have forked his fiddle: here
mounted() {
this.one = "One";
setTimeout(() => {
this.two = "Two"
}, 0);
//this.$nextTick(()=>{
//this.two = "Two"
//})}
You can see in the fiddle that when using setTimeOut, the initial data flashes very briefly once the component gets mounted before adapting the change. Whereas, when using nextTick, the data is hijacked, changed, before rendering to the browser. So, the browser shows the updated data without even any knowledge of the old. Hope that clears the two concepts in one swoop.