Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

572
Vistas
V-Binding Booleans with Radio Buttons

I was trying to set the value of a radio button as a boolean and store this value, but when I did, it didn't seem to work.

<v-radio-group v-model="test" class="pl-2">
  <v-radio
    label="Yes"
    value="true"
    >
  </v-radio>
</v-radio-group>

I finally was able to get it to work when using V-Binding for the value:

<v-radio-group v-model="test" class="pl-2">
  <v-radio
    label="Yes"
    :value="true"
    >
  </v-radio>
</v-radio-group>

Can someone explain why this is the case? I feel like I am missing something in the documentation: https://vuejs.org/v2/guide/forms.html#Radio-1

We are using the composition API, Nuxt framework, and Vuetify (not sure if that matters)

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Attributes are strings by default, so in the first case of:

<v-radio value="true">

...the value prop is actually set to the string "true".

In the second case of:

<v-radio :value="true">

...the v-bind directive evaluates true as a JavaScript expression, and assigns the resulting Boolean to the value prop.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda