[Vuejs]-Element not reacting to the data change – v-if not working

1👍

Try this on script setup part

import { ref } from 'vue';

const show_heading = ref(true);

function toggleHeading() {
   show_heading.value = !show_heading.value;
}

Or you can read this https://vuejs.org/guide/essentials/class-and-style.html#binding-html-classes for toggle. Just doing step by step.

👤Jonas

Leave a comment