Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Vuetify button without changing colors

I'm using Vuetify's v-btn button component with a variety of colors set via the color prop. Once a user clicks the button, I set disabled to true so they can't click it again, but the button loses its color and gets greyed out.

Is there any way to disable the button without changing its color to grey?

like image 527
Chris Avatar asked Jan 02 '19 16:01

Chris


1 Answers

Instead of disabled prop you could use your custom class with pointer-events: none, e.g.

.disable-events {
  pointer-events: none
}

<v-btn :class="{'disable-events': customCondition}">

Then add additional styling to that class if needed.

like image 66
Traxo Avatar answered Nov 01 '22 14:11

Traxo