MdSwitch does not support binding

web
mobile

Topic: MdSwitch does not support binding

Philip Keiter asked 2 years ago

There is no way to set or get the value from the switch.
You can fix by adding this to the input tag:
:checked="value" @change="$emit('input', $event.target.checked)"
And add this to the props:
value: {
    type: Boolean,
    default: false
},

Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: Vue
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No