I bind two radio elements with v-model. When the radio elements were clicked, I want to get a boolean result, but the real result is String TYPE?!
This is my codes:
http://jsbin.com/temesogaje/edit?html,output
Use v-bind
http://jsbin.com/ferejatepi/1/edit?html,output
Thanks a lot!
This is much later, but I was having a similar issue while testing Vue with DOM templates and CDN inclusion of Vue.
Is it possible to get an explanation of why utilizing v-bind on the value is a fix for this, and why the boolean true/false gets changed into a string if not bound? I tried to step through with debugger but was unable to.
@mgrollins By default, DOM attributes are string. If v-bind
is not used, Vue won't override this behavior.
Most helpful comment
Use v-bind
http://jsbin.com/ferejatepi/1/edit?html,output