O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

v-if versus v-show

Even though we have already mentioned a difference between v-if and v-show, we can deepen a bit more. Some questions may arise out of their use. Is there a big difference between using v-show and v-if? Is there a situation where performance is affected? Are there problems where you're better off using one or the other? You might experience that the use of v-show on a lot of situations causes bigger time of load during page rendering. In comparison, v-if is truly conditional according to the guide of Vue.js.

When using v-if , if the condition is false on initial render, it will not do anything-partial compilation won't start until the condition becomes true for the first time. Generally speaking, v-if has higher toggle costs ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required