How can a Vue component button color be changed using a function? Bootstrap-vue is being used. In the code below, the tooltip is changed using a function, how can the same idea be applied to the button? Any help would be greatly appreciated.
Here is the Vue component:
<template>
<div class="text-center">
<b-button v-b-tooltip.hover.right="tooltipText" variant="outline-primary" @click="userHandler(username)">
<div v-bind:class="{ active: checkbox1 }">
{{ username }}
</div>
</b-button>
</div>
</template>
<script>
import EventBus from '../eventBus.js'
export default {
props: ['username', 'checkbox1'],
data() {
return {
show: true,
tooltipTextContent: 'block',
}
},
methods: {
userHandler(username) {
EventBus.$emit('handleUser', username);
},
tooltipText() {
if (!this.checkbox1) {
return this.tooltipTextContent
} else {
return `un${this.tooltipTextContent}`
}
}
},
}
</script>
<style scoped>
.active {
color: red;
}
</style>