Conditional rendering in vue js

Conditional Rendering in Vue makes it easy to toggle the presence of any element in the DOM based on a certain condition. The directives v-if and v-else are used for this purpose.

<template>
  <h1 v-if="val === 'true'">true value</h1>
  <h1 v-else>false value</h1>
</template>
<script>

   export default {
      name: "HeaderComponent",
      methods: {
         eventCall(){   
            val: 'false'          
         }
      },

      data() {
         return {
            val :'true'
         }
      }

    }

</script>

Leave a Reply