Components with default prop value for v-model that are not using one aren't being updated after an update event is emitted
Version
3.0.5
Reproduction link
https://jsfiddle.net/6x0yahsb/
Steps to reproduce
- click
update
button on thebound
test component - watch input getting updated
- click
update
button on thedefault
test component - watch input not being updated
What is expected?
The default
component - component which has a default prop value and is not bound with v-model:value
should be updated as well.
What is actually happening?
The default
component is not being updated whilst the component with v-model:value
gets updated correctly.
Then what in case I have a component that has two v-model
s but sometimes I only care about one value? If I don't pass the second v-model
, the component wouldn't work internally. And creating a data value for every value I don't care of every instance of this component seems like a big overhead to me.
Yes, you need a data property. You can create a composable to handle it. I created a mixin with Vue 2 in mind to handle this case: https://github.com/posva/vue-prop-data-fallback