Hide elements during loading using "v-cloak"


You might not know the v-cloak directive as it happens to be somewhere in the docs where you probably don’t pay attention to it. Until that day where you have a use case.

HTML rendering phases

What can be annoying with Vue.js is that the HTML elements are present in your page before Vue.js reads and compiles it.

Note : I am referring to simple use cases where you render components in an existing app, not SPA setups.


  

     id="app">
      
Hello {{ name }}

In this example, for a brief moment, the whole content of the

element will be rendered in the browser.

It’s only after Vue.js core and the content of the