When you click on a button of a btn-toggle it remains activated and there is no property to configure this behavior.
The workaround :
It consists in resetting the group value to null at each change
<v-btn-toggle v-model="activeButton" @change="resetActiveButton">
<v-btn :loading="executing" @click="execute">Execute</v-btn>
<v-menu offset-y>
<template v-slot:activator="{ on }">
<v-btn v-on="on">
<v-icon>mdi-menu-down</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item @click="reload">
<v-list-item-title>Reload</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-btn-toggle>
export default {
data() {
return {
activeButton: null
}
},
methods: {
resetActiveButton() {
this.$nextTick(() => {
this.activeButton = null
})
}
}
I suggest adding a property like "ignore-active-state: bool (default to false)" which would allow the group to behave like a button and not like a select
Do you mean like #4325, that wasn't actually implemented IMHO.
Ps : esynaps account is mine too
I ended up doing this.
<v-item-group class="v-btn-toggle">
<v-btn>
<v-icon>add</v-icon>
</v-btn>
<v-btn>
<v-icon>remove</v-icon>
</v-btn>
</v-item-group>
It applies the visual style of v-btn-toggle
without changing the functionality of btns.
Most helpful comment
I ended up doing this.
It applies the visual style of
v-btn-toggle
without changing the functionality of btns.