-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
What problem does this feature solve?
Considering this binding:
<input type="text" v-model="data.val1">
This works fine if there is for example { data:{ val1:null }} defined in component-data, but if only { data:{} } is defined it doesn't work correctly because while val1 is created by v-model, it's not made reactive.
By using Vue.set for setting values, this wouldn't be a problem which would make live easiert for certain usecases.
What does the proposed API look like?
No visible change.
But to maintain the actual behaviour this could also be implemented using a modifier like 'set' for example:
<input type="text" v-model.set="data.val1">
This would use Vue.set(data, 'val1', ...) instead of simply generating data.val1 = ...
wanyaxing, mustafakibar, TakahashiEi and mikezone