Appearance
Breaking Changes
This page lists all Vue 3 breaking changes from Vue 2.
While it looks like a lot has changed, a lot of what you know and love about Vue is still the same; but we wanted to be as thorough as possible and provide detailed explanations and examples for every documented change.
Details
Global API
- Global Vue API is changed to use an application instance
- Global and internal APIs have been restructured to be tree-shakable
Template Directives
v-modelusage on components has been reworked, replacingv-bind.synckeyusage on<template v-for>and non-v-fornodes has changedv-ifandv-forprecedence when used on the same element has changedv-bind="object"is now order-sensitivev-on:event.nativemodifier has been removed
Components
- Functional components can only be created using a plain function
functionalattribute on single-file component (SFC)<template>andfunctionalcomponent option are deprecated- Async components now require
defineAsyncComponentmethod to be created - Component events should now be declared with the
emitsoption
Render Function
- Render function API changed
$scopedSlotsproperty is removed and all slots are exposed via$slotsas functions$listenershas been removed / merged into$attrs$attrsnow includesclassandstyleattributes
Custom Elements
- Custom element checks are now performed during template compilation
- Special
isattribute usage is restricted to the reserved<component>tag only
Other Minor Changes
- The
destroyedlifecycle option has been renamed tounmounted - The
beforeDestroylifecycle option has been renamed tobeforeUnmount - Props
defaultfactory function no longer has access tothiscontext - Custom directive API changed to align with component lifecycle and
binding.expressionremoved - The
dataoption should always be declared as a function - The
dataoption from mixins is now merged shallowly - Attributes coercion strategy changed
- Some transition classes got a rename
<TransitionGroup>now renders no wrapper element by default- When watching an array, the callback will only trigger when the array is replaced. If you need to trigger on mutation, the
deepoption must be specified. <template>tags with no special directives (v-if/else-if/else,v-for, orv-slot) are now treated as plain elements and will result in a native<template>element instead of rendering its inner content.- Mounted application does not replace the element it's mounted to
- Lifecycle
hook:events prefix changed tovnode-
Removed APIs
keyCodesupport asv-onmodifiers- $on, $off and $once instance methods
- Filters
- Inline templates attributes
$childreninstance propertypropsDataoption$destroyinstance method. Users should no longer manually manage the lifecycle of individual Vue components.- Global functions
setanddelete, and the instance methods$setand$delete. They are no longer required with proxy-based change detection.