Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to apply style of selected radiobutton in Vuetify

I have a doubt, about how to make in Vuetify the border around the v-card (or some other effect, like background color change) when the Radio button is selected.

<v-radio @change="setGewitchtsVal('3.5t')" label="3.5t" color="primary" value="3.5t" >
  <template v-slot:label>
    <v-card width="170" color="white" class="trucksicons d-flex align-center flex-column rounded-lg">
    <v-img contain height="60" :src="icon35t"></v-img>
    <span>3.5t</span>
    </v-card>
  </template> 
</v-radio>

The current picture of my radiogroup is like this (I removed the radio button pins).

radio button group

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I know, how to make a hover, but not how to highlight selected one.

>Solution :

Use the active-class

<template>
  <v-radio active-class="active" ...>
  ...
  </v-radio>
</template>

<style scoped>
.active .trucksicons {
  border: 2px solid green;
}
</style>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading