Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

563
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!