Vue: Sync prop validation

Created on 11 May 2017  ·  2Comments  ·  Source: vuejs/vue

What problem does this feature solve?

Now that the sync modifier is back, make sense to recover the sync validator as well.

What does the proposed API look like?

If an component relies on the sync modifier should be possible to state it on the prop declaration as:

props: {
  syncedProp: {
   sync: true
  }
}
feature request

Most helpful comment

IMHO, we should not introduce sync prop validation in v2 since sync modifier in v2 is just a syntax suger of corresponding v-on handler. If a child component can have the sync validation, that would mean the child can control the state update strategy of the parent.

All 2 comments

IMHO, we should not introduce sync prop validation in v2 since sync modifier in v2 is just a syntax suger of corresponding v-on handler. If a child component can have the sync validation, that would mean the child can control the state update strategy of the parent.

You may be right. Ok.

Was this page helpful?
0 / 5 - 0 ratings