[Vuejs]-How to change the popup hover state to active state (on click) in vue.js

0👍

The problem is that the :active property on a non clickable element will only trigger a onclick on and off effect. What you actually see. If you want to have a toggle effect you have two options:

  1. You actually use a clickable element to wrap your span such as a button
  2. You use javascript to change your class
   function myFunction() {
    var element = document.getElementById("myDIV");
    element.classList.toggle("mystyle");
  }

You must adapt this to your situation by attaching this kind of function to your click event.

Leave a comment