1.HTML
<div id="app">
<div class="static"
v-bind:class="['test',{ active: isActive, 'text-danger': hasError }]">
</div>
</div>
2.CSS
<style>
.active {
width: 100px;
height: 100px;
background: green;
}
.text-danger {
background: red;
}
.test {
border: 1px solid black;
}
</style>
3.script
<script>
new Vue({
el: '#app',
data: {
isActive: true,
hasError: true
}
})
</script>