v-if Conditional Rendering
The v-if directive sets a JavaScript variable or expression. The specified element is rendered only when the variable or expression evaluates to a truthy value.
The v-if directive can be used in conjunction with the v-else and v-else-if directives.
v-if demo
<template>
<div style="text-align: center;">
<h1 v-if="show">v-if is true</h1>
<h1 v-if="showFalse">v-if is false</h1>
</div>
</template>
<script>
export default {
data(){
return{
show: true,
showFalse: false
}
},
};
</script>