rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Prop modifier for v-model

Open CyberAP opened this issue 5 years ago • 4 comments
trafficstars

Add a prop modifier for v-model to simplify wrapper components.

Rendered

CyberAP avatar Mar 05 '20 20:03 CyberAP

Ref https://github.com/vuejs/rfcs/pull/21

backbone87 avatar Mar 05 '20 22:03 backbone87

Ref #21

Thanks for linking a related issue. I knew someone has already proposed that!

But there are some key differences from the #21 proposal that I'd like to mention:

  • #140 is promoting explicit behaviour compared to implicit in #21
  • at the moment #21 was proposed there was no first class support for modifiers in v-model and multiple v-models. With the new v-model API it can be even more challenging to wrap components that accept multiple v-models.

CyberAP avatar Mar 05 '20 22:03 CyberAP

I really like this, wrapping something should be just as easy as "wrapping it"!

victornpb avatar Jul 05 '20 19:07 victornpb

I absolutely support this and this is the best among rfcs about this problem. This really reduces a lot of code when we wrap things.

v-model is already (presented as) a syntactic sugar for binding and emitting, so a modifier for v-model would modify the syntactic sugar a bit.

yooneskh avatar Jun 22 '21 19:06 yooneskh