-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
Description
Hello,
I'm writing a data-driven custom component that renders different input types from its data.
This component supports types like radio / checkbox / textarea etc.
All these types works fine with v-model directive on the component except of the radio type.
I found why: Vue2 hooks up the onChange event by adding :
'onChange': function(event){ myProp = undefined }
The component looks like this:
<dyn-component type="radio" ... ></dyn-component>
and renders something like this:
<div class="form-group">
<label><input type="radio" /></label>
<label><input type="radio" /></label>
</div>
In fact, Vue2 considers that my component is an input type="radio" but this component renders internaly a radio-button list...
The workaround I used is to change the type from radio to radio-list, but maybe Vue should also check the tag name to be input in addition to the type="radio" attribute check.