0
First of all you can’t have 2 class bindings on the same element, nor should you need them.
You have quite a lot of logic regarding adding/removing classes, so i would suggest extracting it to a computed:
computed: {
className () {
let classes= [];
if (this.animationToggle){
classes.push(this.activeClass)
}
else{
classes.push('swingLeft')
}
return classes;
}
}
}
<div id="bag" :class="className"></div>
- [Vuejs]-How does the writing of the Vue sub component JSX get the passing $attrs?
- [Vuejs]-How can i do search filter on vue js 2.5.16?
Source:stackexchange.com