Vue: The problem of radio and v-model?

Created on 7 Jul 2016  路  4Comments  路  Source: vuejs/vue

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

Most helpful comment

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings