March 2018
Beginner to intermediate
344 pages
7h 7m
English
If we'd like to conditionally remove the element from the DOM, we can use v-if. Let's replace our previous v-show directive with v-if:
<article v-if="admin"> <header>Protected Content</header> <section class="main"> <h1>If you can see this, you're an admin!</h1> </section> </article>
Notice that now when we look at the DOM, the element is entirely removed:

Read now
Unlock full access