-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
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>
Metadata
Metadata
Assignees
Labels
No labels