I'm trying to set a class depending on if certain values are true.
My div:
<template>
<div class="navbar" v-bind:class=" {'test1': static, 'test2': isActive } ">
</template>
and in the script part of my component, I've written this:
<script>
export default {
name: 'my-component',
data: {
static: true,
isActive: true
}
}
</script>
According to my understanding, this should show both the test1 class, and the test2 class. What am I misunderstanding -- shouldn't this be working? I want to toggle classes on click of a button, but I can't get this part working.