Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue3 v-model API changes #1039

Conversation

przemkow
Copy link
Contributor

@przemkow przemkow commented Jan 25, 2020

Add suppor for v-model API changes

  • support for v-model:argument syntax (replacement for v-bind.sync)
  • support for v-model.customModifier syntax

Relates to:
#1035
RFC0005
RFC0011

Scope:

  • vue/valid-v-model - modify rule implementation to do not report an error when:

    • v-model is used with an argument on Vue Component. (v-model:argument syntax)
    • v-model is used with custom modifiers on Vue Component. (v-model. customModifier syntax)
  • vue/no-v-model-argument- new rule which reports an error when v-model is used with an argument on Vue Component (Vue 2 backward compatibility rule, previously handled by vue/valid-v-model)

  • vue/no-deprecated-v-bind-sync - new rule which reports an error when deprecated .sync modifier is used on v-bind directive.

  • vue/no-custom-modifiers-on-v-model - new rule which reports an error when v-model is used with custom modifiers on Vue Component (Vue 2 backward compatibility rule, previously handled by vue/valid-v-model)

Clarification needed:

  • Object spread behaviour (previously handled by v-bind.sync="xxx").
    According to RFC it's not clear which option was selected for the final implementation. Testing that with Vue 3.0.0-alpha.3 it seems that spread on v-model is currently not supported, nevertheless, it requires additional confirmation before merge.

@przemkow przemkow force-pushed the RFC0005/replace-v-bind-sync-with-v-model-argument branch from 723ffab to a1d0547 Compare January 25, 2020 21:30
@ota-meshi ota-meshi mentioned this pull request Jan 26, 2020
75 tasks
@przemkow przemkow force-pushed the RFC0005/replace-v-bind-sync-with-v-model-argument branch from a1d0547 to 900f89e Compare January 26, 2020 13:39
@przemkow przemkow changed the title RFC0005/replace v-bind sync with v-model argument Vue 3 v-model API changes Jan 26, 2020
@przemkow przemkow changed the title Vue 3 v-model API changes Vue3 v-model API changes Jan 26, 2020
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! And sorry for the late reply.

I have some requests.

lib/rules/no-deprecated-v-bind-sync.js Show resolved Hide resolved
tests/lib/rules/no-deprecated-v-bind-sync.js Show resolved Hide resolved
tests/lib/rules/no-deprecated-v-bind-sync.js Show resolved Hide resolved
lib/rules/no-deprecated-v-bind-sync.js Outdated Show resolved Hide resolved
@przemkow przemkow force-pushed the RFC0005/replace-v-bind-sync-with-v-model-argument branch from 900f89e to 009ff3e Compare March 8, 2020 13:48
@przemkow przemkow requested a review from ota-meshi March 8, 2020 14:07
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for changing this PR! LGTM!

@ota-meshi ota-meshi merged commit ef95155 into vuejs:master Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants