let app = new Vue({
el: '#app',
data: {
app_class: {
red: true,
big:true
},
},
methods: {
isClassActive: function () {
this.app_class.red = !this.app_class.red;
this.app_class.big = !this.app_class.big;
}
}
});
<div id="app">
<p :class="app_class">23333</p>
<button @click="isClassActive()">active or not</button>
</div>
.red{
background-color: red;
}
.big{
font-size: 3em;
}