Vuetify: [Bug Report] false-value is not return undefined

Created on 22 May 2019  路  3Comments  路  Source: vuetifyjs/vuetify

Versions and Environment

Vuetify: 1.5.14
Vue: 2.6.6
Browsers: Chrome 74.0.3729.157
OS: Windows 10

Steps to reproduce

set false-value to undefined in v-checkbox like this:

 <v-checkbox v-model="checkbox" label="Checkbox" :value="true" :false-value="undefined"></v-checkbox>

Expected Behavior

value is undefined

Actual Behavior

value is null

Reproduction Link

https://codepen.io/shlomilevi/pen/BeJJbM?&editable=true&editors=101

Other comments

Full code

<div id="app">
  <v-app id="inspire">
    <v-container fluid>
      checkbox: {{checkbox | json }}

      <v-checkbox v-model="checkbox" label="Checkbox" :value="true" :false-value="undefined"></v-checkbox>
    </v-container>
  </v-app>
</div>
VCheckbox bug has workaround

Most helpful comment

  • false-value only works with true-value, not value

    • You can use a function to trick it: :true-value="true" :false-value="() => undefined"

All 3 comments

Correct I edit my issue and codepen.

The problem is still happen

  • false-value only works with true-value, not value

    • You can use a function to trick it: :true-value="true" :false-value="() => undefined"

Was this page helpful?
0 / 5 - 0 ratings