--- title: v-model Breaking Changes from Vue 2 to Vue 3 impact: HIGH impactDescription: Vue 3 changed v-model prop/event names and removed .sync modifier - migration required type: migration tags: [vue3, vue2, v-model, migration, breaking-changes, sync] --- # v-model Breaking Changes from Vue 2 to Vue 3 **Impact: HIGH** - Vue 3 fundamentally changed how v-model works on custom components. Code using the Vue 2 pattern will silently fail - the component won't receive the prop value and changes won't propagate to the parent. ## Task Checklist - [ ] Change prop name from `value` to `modelValue` - [ ] Change event name from `input` to `update:modelValue` - [ ] Replace `.sync` modifier with `v-model:propName` - [ ] Remove `model` component option (use defineModel or named v-model) - [ ] Update any v-bind.sync to v-model with named argument ## Key Breaking Changes | Feature | Vue 2 | Vue 3 | |---------|-------|-------| | Default prop | `value` | `modelValue` | | Default event | `input` | `update:modelValue` | | Custom name | `model: { prop, event }` | `v-model:customName` | | Sync modifier | `v-bind:prop.sync` | `v-model:prop` | | Multiple models | Not supported | Fully supported | **Vue 2 Pattern (No longer works in Vue 3):** ```vue ``` **Vue 3 Pattern (Options API):** ```vue ``` **Vue 3 Pattern (Composition API with defineModel):** ```vue ``` ## Migrating the .sync Modifier Vue 2's `.sync` modifier is removed. Use named v-model instead. **Vue 2:** ```vue ``` **Vue 3:** ```vue ``` ## Migrating Custom model Option Vue 2's `model` component option is removed. **Vue 2:** ```vue ``` **Vue 3:** ```vue ``` ## Multiple v-model Bindings (New in Vue 3) Vue 3 allows multiple v-model directives on a single component: ```vue ``` ## Reference - [Vue 3 Migration Guide - v-model](https://v3-migration.vuejs.org/breaking-changes/v-model) - [Vue.js Component v-model](https://vuejs.org/guide/components/v-model.html)