I do it by removing v-btn--disabled
and playing with vuetify's css classes.
Still grey but with colored text solution
The button will still be grey, but text will be colored, like that you have a visual effect showing that the button is disabled but still have a colored part.
I, personally, also had some custom opacity to disabled buttons.
<v-btn id="btnA" :disabled="true" color="success">Success</v-btn>
button.v-btn[disabled] {
opacity: 0.6;
}
created(){
// Trick to remove class after initialising form
this.$nextTick(() => {
document.getElementById('btnA').classList.remove('v-btn--disabled')
})
}
CodePen
Same display solution
If you really want, the same display you will have to remove [color]--text
and add [color]
class (and sometimes add white--text
class for readability).
created(){
// Trick to remove class after initialising form
this.$nextTick(() => {
document.getElementById('btnA').classList.remove('v-btn--disabled')
document.getElementById('btnA').classList.remove('success--text')
document.getElementById('btnA').classList.add('success')
})
}
CodePen
disabled
prop can't you just use your custom class withpointer-events: none
? Then add additional styling to that class if needed (not sure if you still want it to appear clickable and interactive, even when disabled?). Additionally you can use vue'sonce
modifier if that helps@click.once="val = !val"
– Chalcographypointer-events
. That ended up being the easiest solution for me in my case. – Pirandello