Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value conflicts with v-model #1167

Closed
capipo opened this issue Nov 18, 2017 · 3 comments
Closed

value conflicts with v-model #1167

capipo opened this issue Nov 18, 2017 · 3 comments

Comments

@capipo
Copy link

capipo commented Nov 18, 2017

Steps to reproduce

After clone vue-material

cd vue-material
npm install
npm run dev

Which browser?

firefox quantum

google-chrome

What is expected?

compilation completed successfully

What is actually happening?

 ERROR  Failed to compile with 1 errors

 error  in ./docs/app/pages/Components/Radio/examples/RegularRadio.vue

(Emitted value instead of an instance of Error)
  Error compiling template:

  <div>
    <md-radio v-model="radio" :value="false">Boolean</md-radio>
    <md-radio v-model="radio" value="my-radio">String</md-radio>
    <md-radio v-model="radio">No Value</md-radio>
    <md-radio v-model="radio" disabled>Disabled</md-radio>

    <small>Model value: {{ radio }}</small>
  </div>

  - :value conflicts with v-model on the same element because the latter already expands to a value binding internally


 @ ./docs/app/pages/Components/Radio/examples/RegularRadio.vue 10:0-286
 @ ./docs/app/pages lazy ^\.\/.*$
 @ ./docs/app/config.js
 @ ./docs/app/index.js
 @ multi ./docs/app/index.js ./build/local/client

Proposed solution

According to the mozilla documentation, the <input type="radio"> control has a attribute value that is a DOMString which is nothing more than a UTF-16 String.

Maybe we should not swim against the current and let MdRadio only accept String.

I can help develop this solution but first I would like to know if you agree in making MdRadio only accept String

@VdustR
Copy link
Member

VdustR commented Nov 18, 2017

It's a vue-template-compiler bug.

vuejs/vue#7084.

You could install the packages with packages version recorded in yarn.lock via yarn install or downgrade vue and vue-template-compiler to v2.5.4 before that fixed.

@capipo
Copy link
Author

capipo commented Nov 18, 2017

Maybe we should listen to the warning and not use v-bind: value and v-model at the same time.

I need to analyze it better, but now I'm a bit busy, I'll close the issue for now and maybe later I'll discuss it again

@capipo capipo closed this as completed Nov 18, 2017
@VdustR
Copy link
Member

VdustR commented Nov 19, 2017

It's fixed in v2.5.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants