[Vuejs]-Vue js – Getting Methods to work in Components

1👍

You need to use this so that you can access the component properies:

toggleClass(){
     this.isActive = !this.isActive;
}

-1👍

That’s not how toggleClass works, there must be a command for this argument, you need to set it to true in the parameters else it will get stuck on the argument.

Could you try

methods: {
    toggleClass(true){
       //     isActive: true
    }
}
});

Leave a comment