[Vuejs]-VueJS 3 changing background on clicking a container

0👍

You can simply bind class property in the container so it takes the desired value

<div :class="desiredClass"  class="h-36 w-full.....

and in your showConfig function you can update the value of desiredClass accordingly

this.desiredClass = "h-26"

you may want also to declare desiredClass as a reactive state .

Leave a comment