Skip to content

Conversation

FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Jul 28, 2023

Follow-up to #2238.

I now tested the (unreleased) rule in a large codebase that is currently prepared for upgrading to Vue 3. There, I noticed that allowing anything different than modelValue/update:modelValue or model-value/update:model-value does not make sense: You'd still need to change v-model to v-model:fooBar in the actual Vue 3 migration if your model specified fooBar/update:fooBar.

So it's better to either rename the model definition to modelValue/update:modelValue or model-value/update:model-value and keep using v-model, or to rename the model definition to fooBar/update:fooBar and also update all v-models to :fooBar="…" @update:fooBar="… = $event", and after the Vue 3 migration change it to v-model:fooBar with #2237.

Therefore, I changed the rule and the suggestions to only allow modelValue/update:modelValue or model-value/update:model-value.

@FloEdelmann FloEdelmann requested a review from ota-meshi July 28, 2023 12:50
@FloEdelmann FloEdelmann changed the title vue/no-deprecated-model-definition compat mode: only allow modelValue Only allow modelValue in vue/no-deprecated-model-definition compat Jul 28, 2023
@FloEdelmann FloEdelmann changed the title Only allow modelValue in vue/no-deprecated-model-definition compat Only allow modelValue in vue/no-deprecated-model-definition Jul 28, 2023
@ota-meshi ota-meshi merged commit b8814c7 into master Jul 29, 2023
@ota-meshi ota-meshi deleted the deprecated-model branch July 29, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants