Closed
Description
I'm sorry I cannot provide a jsfiddle example (because I cannot find the cdn / rawgit for the latest dev code), instead here is the code I test on my machine with the latest dev vue (latest commit: eb95383).
<div id="app">
<my-comp></my-comp>
</div>
<script>
new Vue({
el: '#app',
components: {
'my-comp': {
template: '<div>{{a}} - <input type="checkbox" v-model="a"></div>',
replace: true,
props: {
a: {
default: false,
type: Boolean
}
},
data() {
return {
b: 123
};
}
}
}
});
</script>
In the above example, the v-model
won't update the view's value.
In the above example, the v-model
will update the model's value, but the model's value won't trigger the view to update because the model's value is not proxied.
The problem is that the initProp
will set the default prop value on the vm, not an observable, and the _initData
won't observe them also in some situation. Here is the cases:
data()
(also means nodata
options for instance) not supplied: because the_data
is still thepropsData
, so the data will always be proxied even if it's no explicit set.data()
supplied: the__data
will be set to theoptionsData
, it will only proxy theoptionsData
, which means when the unproxied property value changes, nothing will be sync.
Metadata
Metadata
Assignees
Labels
No labels