diff --git a/src/.vuepress/components/MigrationBadges.vue b/src/.vuepress/components/MigrationBadges.vue
new file mode 100644
index 0000000000..d256d78cb6
--- /dev/null
+++ b/src/.vuepress/components/MigrationBadges.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+ {{ badgeType }}
+
+
+
+
+
diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl
index 757341eb43..f92d5035c5 100644
--- a/src/.vuepress/theme/styles/index.styl
+++ b/src/.vuepress/theme/styles/index.styl
@@ -128,6 +128,7 @@ h1, h2, h3, h4, h5, h6
&:first-child
display flex
+ flex-wrap wrap
align-items center
margin-top -1.5rem
margin-bottom 1rem
diff --git a/src/guide/migration/async-components.md b/src/guide/migration/async-components.md
index 372e63cfdf..ee0b1c9f2c 100644
--- a/src/guide/migration/async-components.md
+++ b/src/guide/migration/async-components.md
@@ -1,4 +1,9 @@
-# Async Components
+---
+badges:
+ - new
+---
+
+# Async Components
## Overview
diff --git a/src/guide/migration/attribute-coercion.md b/src/guide/migration/attribute-coercion.md
index 8a7edf4da4..cd1d169534 100644
--- a/src/guide/migration/attribute-coercion.md
+++ b/src/guide/migration/attribute-coercion.md
@@ -1,4 +1,9 @@
-# Attribute Coercion Behavior
+---
+badges:
+ - breaking
+---
+
+# Attribute Coercion Behavior
::: info Info
This is a low-level internal API change and does not affect most developers.
@@ -27,7 +32,7 @@ In 2.x, we had the following strategies for coercing `v-bind` values:
The following table describes how Vue coerce "enumerated attributes" differently with normal non-boolean attributes:
-| Binding expression | `foo` normal | `draggable` enumerated |
+| Binding expression | `foo` normal | `draggable` enumerated |
| ------------------- | ----------------------- | --------------------------------- |
| `:attr="null"` | / | `draggable="false"` |
| `:attr="undefined"` | / | / |
@@ -53,7 +58,7 @@ For non-boolean attributes, Vue will stop removing them if they are `false` and
The following table describes the new behavior:
-| Binding expression | `foo` normal | `draggable` enumerated |
+| Binding expression | `foo` normal | `draggable` enumerated |
| ------------------- | -------------------------- | --------------------------------- |
| `:attr="null"` | / | / † |
| `:attr="undefined"` | / | / |
diff --git a/src/guide/migration/custom-directives.md b/src/guide/migration/custom-directives.md
index 7e80d040e3..a0a5bb96d5 100644
--- a/src/guide/migration/custom-directives.md
+++ b/src/guide/migration/custom-directives.md
@@ -1,4 +1,9 @@
-# Custom Directives
+---
+badges:
+ - breaking
+---
+
+# Custom Directives
## Overview
diff --git a/src/guide/migration/custom-elements-interop.md b/src/guide/migration/custom-elements-interop.md
index efdda91626..d492676b76 100644
--- a/src/guide/migration/custom-elements-interop.md
+++ b/src/guide/migration/custom-elements-interop.md
@@ -1,9 +1,9 @@
---
-types:
+badges:
- breaking
---
-# Custom Elements Interop changes {{ type }}
+# Custom Elements Interop changes
# Overview
diff --git a/src/guide/migration/data-option.md b/src/guide/migration/data-option.md
index 2a4dc6be52..513f3edbbd 100644
--- a/src/guide/migration/data-option.md
+++ b/src/guide/migration/data-option.md
@@ -1,9 +1,10 @@
---
-types:
+title: Data Option
+badges:
- breaking
---
-# Data Option {{ type }}
+# {{ $frontmatter.title }}
## Overview
diff --git a/src/guide/migration/events-api.md b/src/guide/migration/events-api.md
index 5c347c9e5b..c0b5709b47 100644
--- a/src/guide/migration/events-api.md
+++ b/src/guide/migration/events-api.md
@@ -1,10 +1,9 @@
---
-types:
- - removed
+badges:
- breaking
---
-# Events API {{ type }}
+# Events API
## Overview
diff --git a/src/guide/migration/filters.md b/src/guide/migration/filters.md
index 101e8c15c6..7f8a29ba7b 100644
--- a/src/guide/migration/filters.md
+++ b/src/guide/migration/filters.md
@@ -1,10 +1,9 @@
---
-types:
+badges:
- removed
- - breaking
---
-# Filters {{ type }}
+# Filters
## Overview
diff --git a/src/guide/migration/fragments.md b/src/guide/migration/fragments.md
index bd68409a7b..074179a9ad 100644
--- a/src/guide/migration/fragments.md
+++ b/src/guide/migration/fragments.md
@@ -1,4 +1,9 @@
-# Fragments
+---
+badges:
+ - new
+---
+
+# Fragments
## Overview
diff --git a/src/guide/migration/functional-components.md b/src/guide/migration/functional-components.md
index 14d0af8079..056b899688 100644
--- a/src/guide/migration/functional-components.md
+++ b/src/guide/migration/functional-components.md
@@ -1,4 +1,9 @@
-# Functional Components
+---
+badges:
+ - breaking
+---
+
+# Functional Components
## Overview
@@ -6,8 +11,8 @@ In terms of what has changed, at a high level:
- Performance gains from 2.x for functional components are now negligible in 3.x, so we recommend just using stateful components
- Functional components can only be created using a plain function that receives `props` and `context` (i.e., `slots`, `attrs`, `emit`)
-- **DEPRECATED:** `functional` attribute on single-file component (SFC) `` is deprecated
-- **DEPRECATED:** `{ functional: true }` option in components created by functions is deprecated
+- **BREAKING:** `functional` attribute on single-file component (SFC) `` is removed
+- **BREAKING:** `{ functional: true }` option in components created by functions is removed
For more information, read on!
diff --git a/src/guide/migration/global-api-treeshaking.md b/src/guide/migration/global-api-treeshaking.md
index 0bf08c69a0..9555ee21d6 100644
--- a/src/guide/migration/global-api-treeshaking.md
+++ b/src/guide/migration/global-api-treeshaking.md
@@ -1,4 +1,9 @@
-# Global API Treeshaking
+---
+badges:
+ - breaking
+---
+
+# Global API Treeshaking
## 2.x Syntax
@@ -96,11 +101,7 @@ is compiled into something similar to the following:
import { h, Transition, withDirectives, vShow } from 'vue'
export function render() {
- return h(Transition, [
- withDirectives(h('div', 'hello'), [
- [vShow, this.ok]
- ])
- ])
+ return h(Transition, [withDirectives(h('div', 'hello'), [[vShow, this.ok]])])
}
```
diff --git a/src/guide/migration/global-api.md b/src/guide/migration/global-api.md
index 827d8620d2..da2c4bf9ef 100644
--- a/src/guide/migration/global-api.md
+++ b/src/guide/migration/global-api.md
@@ -1,4 +1,9 @@
-# Global API
+---
+badges:
+ - breaking
+---
+
+# Global API
Vue 2.x has a number of global APIs and configurations that globally mutate Vue’s behavior. For instance, to create a global component, you would use the `Vue.component` API like this:
@@ -23,18 +28,18 @@ While this approach is convenient, it leads to a couple of problems. Technically
- Global configuration makes it easy to accidentally pollute other test cases during testing. Users need to carefully store original global configuration and restore it after each test (e.g. resetting `Vue.config.errorHandler`). Some APIs like `Vue.use` and `Vue.mixin` don't even have a way to revert their effects. This makes tests involving plugins particularly tricky. In fact, vue-test-utils has to implement a special API `createLocalVue` to deal with this:
- ```js
- import { createLocalVue, mount } from '@vue/test-utils'
+```js
+import { createLocalVue, mount } from '@vue/test-utils'
- // create an extended `Vue` constructor
- const localVue = createLocalVue()
+// create an extended `Vue` constructor
+const localVue = createLocalVue()
- // install a plugin “globally” on the “local” Vue constructor
- localVue.use(MyPlugin)
+// install a plugin “globally” on the “local” Vue constructor
+localVue.use(MyPlugin)
- // pass the `localVue` to the mount options
- mount(Component, { localVue })
- ```
+// pass the `localVue` to the mount options
+mount(Component, { localVue })
+```
- Global configuration makes it difficult to share the same copy of Vue between multiple "apps" on the same page, but with different global configurations.
diff --git a/src/guide/migration/inline-template-attribute.md b/src/guide/migration/inline-template-attribute.md
index ea7983d6bc..1ae9810315 100644
--- a/src/guide/migration/inline-template-attribute.md
+++ b/src/guide/migration/inline-template-attribute.md
@@ -1,10 +1,9 @@
---
-types:
+badges:
- breaking
- - removal
---
-# Inline Template Attribute
+# Inline Template Attribute
## Overview
@@ -68,7 +67,7 @@ A component previously using `inline-template` can also be refactored using the
```
-The child, instead of providing no template, should now render the default slot*:
+The child, instead of providing no template, should now render the default slot\*:
```html