Skip to content

issue of binding v-model with $value #761

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

Closed
fouber opened this issue Apr 1, 2015 · 1 comment
Closed

issue of binding v-model with $value #761

fouber opened this issue Apr 1, 2015 · 1 comment

Comments

@fouber
Copy link

fouber commented Apr 1, 2015

the code:

<div id="test"></div>
<script type="x-template" id="tpl">
  <div v-repeat="obj">
    <label>{{$key}}: {{$value}}</label>
    <input type="text" v-model="$value"/>
  </div>
  <button v-on="click: onTest">alert(foo)</button>
</script>
<script>
  new Vue({
    template: '#tpl',
    el: '#test',
    data: {
      obj: {
        foo: 'test'
      }
    },
    methods: {
      onTest: function(){
        console.log(this.obj.foo);  // nothing changed, why?
      }
    }
  });
</script>

jsbin: http://jsbin.com/gubadejonu/1/

@fouber fouber changed the title issue of binding $value and v-model issue of binding v-model with $value Apr 1, 2015
@fouber
Copy link
Author

fouber commented Apr 5, 2015

good job!

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