Skip to content

Commit 3090b99

Browse files
Merge branch 'master' of github.com:vuejs/docs-next
2 parents 67989be + 9301981 commit 3090b99

32 files changed

+229
-75
lines changed

assets/diagrams.sketch

-488 Bytes
Binary file not shown.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<script>
2+
const validBadges = ['new', 'breaking', 'removed', 'updated']
3+
4+
export default {
5+
props: {
6+
badges: {
7+
type: Array,
8+
default: () => [],
9+
validator(value) {
10+
return validBadges.includes(value)
11+
}
12+
}
13+
}
14+
}
15+
</script>
16+
17+
<template>
18+
<div class="migration-badge-wrapper">
19+
<span
20+
v-for="badgeType in badges"
21+
:class="`migration-badge is-${badgeType}`"
22+
:key="`badge-type-${badgeType}`"
23+
>
24+
{{ badgeType }}
25+
</span>
26+
</div>
27+
</template>
28+
29+
<style lang="scss" scoped>
30+
.migration-badge {
31+
background-color: #ccc;
32+
font-size: 0.8rem;
33+
border: 2px solid #ccc;
34+
border-radius: 5px;
35+
margin-right: 0.5rem;
36+
margin-top: 0.5rem;
37+
color: #222;
38+
padding: 0.25rem 0.25rem;
39+
font-weight: bold;
40+
41+
&:first-child {
42+
margin-left: 1rem;
43+
}
44+
45+
&.is-new {
46+
background-color: #228740;
47+
border-color: #228740;
48+
color: #fff;
49+
}
50+
51+
&.is-breaking {
52+
background-color: #b00000;
53+
border-color: #b00000;
54+
color: #fff;
55+
}
56+
57+
&.is-removed {
58+
background-color: #cf8700;
59+
border-color: #cf8700;
60+
color: #fff;
61+
}
62+
63+
&.is-updated {
64+
background-color: #fcff44;
65+
border-color: #fcff44;
66+
color: #222;
67+
}
68+
}
69+
70+
.migration-badge-wrapper {
71+
display: flex;
72+
margin-top: -0.5rem;
73+
}
74+
</style>
231 KB
Loading

src/.vuepress/theme/components/PageNav.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
<OutboundLink />
2929
</a>
3030

31-
<RouterLink v-else :to="next.path">{{ next.title || next.path }}</RouterLink>→
31+
<RouterLink v-else :to="next.path">{{ next.title || next.path }}</RouterLink>
32+
3233
</span>
3334
</p>
3435
</div>

src/.vuepress/theme/styles/index.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ h1, h2, h3, h4, h5, h6
128128

129129
&:first-child
130130
display flex
131+
flex-wrap wrap
131132
align-items center
132133
margin-top -1.5rem
133134
margin-bottom 1rem

src/api/composition-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const MyComponent = {
102102

103103
These lifecycle hook registration functions can only be used synchronously during [`setup()`](#setup), since they rely on internal global state to locate the current active instance (the component instance whose `setup()` is being called right now). Calling them without a current active instance will result in an error.
104104

105-
The component instance context is also set during the synchronous execution of lifecycle hooks, so watchers and computed properties created inside synchronously inside lifecycle hooks are also automatically tore down when the component unmounts.
105+
The component instance context is also set during the synchronous execution of lifecycle hooks. As a result, watchers and computed properties created synchronously inside of lifecycle hooks are also automatically tore down when the component unmounts.
106106

107107
- **Mapping between Options API Lifecycle Options and Composition API**
108108

src/api/instance-properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ An object of DOM elements and component instances, registered with [`ref` attrib
143143
Contains parent-scope attribute bindings and events that are not recognized (and extracted) as component [props](./options-data.html#props) or [custom events](./options-data.html#emits). When a component doesn't have any declared props or custom events, this essentially contains all parent-scope bindings, and can be passed down to an inner component via `v-bind="$attrs"` - useful when creating higher-order components.
144144

145145
- **See also:**
146-
- [Non-Prop Attributes](../guide/component-props.html#non-prop-attributes)
146+
- [Non-Prop Attributes](../guide/component-attrs.html)

src/guide/component-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ See [this sandbox](https://codepen.io/team/Vue/pen/oNXaoKy) to experiment with t
427427

428428
Keep in mind that this attribute can be used with regular HTML elements, however they will be treated as components, which means all attributes **will be bound as DOM attributes**. For some properties such as `value` to work as you would expect, you will need to bind them using the [`.prop` modifier](../api/directives.html#v-bind).
429429

430-
That's all you need to know about dynamic components for now, but once you've finished reading this page and feel comfortable with its content, we recommend coming back later to read the full guide on [Dynamic & Async Components](./components-dynamic-async.html).
430+
That's all you need to know about dynamic components for now, but once you've finished reading this page and feel comfortable with its content, we recommend coming back later to read the full guide on [Dynamic & Async Components](./component-dynamic-async.html).
431431

432432
## DOM Template Parsing Caveats
433433

src/guide/component-slots.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ You can even define fallbacks, to be used in case a slot prop is undefined:
366366
```html
367367
<todo-list v-slot="{ item = 'Placeholder' }">
368368
<i class="fas fa-check"></i>
369-
<span class="green">{{ todo }}<span>
369+
<span class="green">{{ item }}<span>
370370
</todo-list>
371371
```
372372

src/guide/custom-directive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ To explain the details of how custom directives will work on components in 3.0,
220220
Will roughly compile into this:
221221

222222
```js
223-
const vFoo = resolveDirective('demo')
223+
const vDemo = resolveDirective('demo')
224224

225225
return withDirectives(h('div'), [[vDemo, test]])
226226
```

src/guide/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Release Notes
44

5-
Latest beta version: 3.0.0-rc.1
5+
Latest beta version: 3.0.0-rc.5
66

77
Detailed release notes for each version are available on [GitHub](https://github.com/vuejs/vue-next/releases).
88

src/guide/migration/async-components.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Async Components
1+
---
2+
badges:
3+
- new
4+
---
5+
6+
# Async Components <MigrationBadges :badges="$frontmatter.badges" />
27

38
## Overview
49

src/guide/migration/attribute-coercion.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Attribute Coercion Behavior
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# Attribute Coercion Behavior <MigrationBadges :badges="$frontmatter.badges" />
27

38
::: info Info
49
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:
2732

2833
The following table describes how Vue coerce "enumerated attributes" differently with normal non-boolean attributes:
2934

30-
| Binding expression | `foo` <sup>normal</sup> | `draggable` <sup>enumerated</sup> |
35+
| Binding expression | `foo` <sup>normal</sup> | `draggable` <sup>enumerated</sup> |
3136
| ------------------- | ----------------------- | --------------------------------- |
3237
| `:attr="null"` | / | `draggable="false"` |
3338
| `:attr="undefined"` | / | / |
@@ -53,7 +58,7 @@ For non-boolean attributes, Vue will stop removing them if they are `false` and
5358

5459
The following table describes the new behavior:
5560

56-
| Binding expression | `foo` <sup>normal</sup> | `draggable` <sup>enumerated</sup> |
61+
| Binding expression | `foo` <sup>normal</sup> | `draggable` <sup>enumerated</sup> |
5762
| ------------------- | -------------------------- | --------------------------------- |
5863
| `:attr="null"` | / | / <sup>†</sup> |
5964
| `:attr="undefined"` | / | / |

src/guide/migration/custom-directives.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Custom Directives
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# Custom Directives <MigrationBadges :badges="$frontmatter.badges" />
27

38
## Overview
49

src/guide/migration/custom-elements-interop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
types:
2+
badges:
33
- breaking
44
---
55

6-
# Custom Elements Interop changes <span v-for="type in $frontmatter.types" class="badge" :key="`type-${type}`">{{ type }}</span>
6+
# Custom Elements Interop changes <MigrationBadges :badges="$frontmatter.badges" />
77

88
# Overview
99

src/guide/migration/data-option.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
types:
2+
title: Data Option
3+
badges:
34
- breaking
45
---
56

6-
# Data Option <span v-for="type in $frontmatter.types" class="badge" :key="`type-${type}`">{{ type }}</span>
7+
# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />
78

89
## Overview
910

src/guide/migration/events-api.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
types:
3-
- removed
2+
badges:
43
- breaking
54
---
65

7-
# Events API <span v-for="type in $frontmatter.types" class="badge" :key="`type-${type}`">{{ type }}</span>
6+
# Events API <MigrationBadges :badges="$frontmatter.badges" />
87

98
## Overview
109

src/guide/migration/filters.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
types:
2+
badges:
33
- removed
4-
- breaking
54
---
65

7-
# Filters <span v-for="type in $frontmatter.types" class="badge" :key="`type-${type}`">{{ type }}</span>
6+
# Filters <MigrationBadges :badges="$frontmatter.badges" />
87

98
## Overview
109

src/guide/migration/fragments.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Fragments
1+
---
2+
badges:
3+
- new
4+
---
5+
6+
# Fragments <MigrationBadges :badges="$frontmatter.badges" />
27

38
## Overview
49

src/guide/migration/functional-components.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# Functional Components
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# Functional Components <MigrationBadges :badges="$frontmatter.badges" />
27

38
## Overview
49

510
In terms of what has changed, at a high level:
611

712
- Performance gains from 2.x for functional components are now negligible in 3.x, so we recommend just using stateful components
813
- Functional components can only be created using a plain function that receives `props` and `context` (i.e., `slots`, `attrs`, `emit`)
9-
- **DEPRECATED:** `functional` attribute on single-file component (SFC) `<template>` is deprecated
10-
- **DEPRECATED:** `{ functional: true }` option in components created by functions is deprecated
14+
- **BREAKING:** `functional` attribute on single-file component (SFC) `<template>` is removed
15+
- **BREAKING:** `{ functional: true }` option in components created by functions is removed
1116

1217
For more information, read on!
1318

src/guide/migration/global-api-treeshaking.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Global API Treeshaking
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# Global API Treeshaking <MigrationBadges :badges="$frontmatter.badges" />
27

38
## 2.x Syntax
49

@@ -96,11 +101,7 @@ is compiled into something similar to the following:
96101
import { h, Transition, withDirectives, vShow } from 'vue'
97102

98103
export function render() {
99-
return h(Transition, [
100-
withDirectives(h('div', 'hello'), [
101-
[vShow, this.ok]
102-
])
103-
])
104+
return h(Transition, [withDirectives(h('div', 'hello'), [[vShow, this.ok]])])
104105
}
105106
```
106107

src/guide/migration/global-api.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Global API
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# Global API <MigrationBadges :badges="$frontmatter.badges" />
27

38
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:
49

@@ -23,18 +28,18 @@ While this approach is convenient, it leads to a couple of problems. Technically
2328

2429
- 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:
2530

26-
```js
27-
import { createLocalVue, mount } from '@vue/test-utils'
31+
```js
32+
import { createLocalVue, mount } from '@vue/test-utils'
2833

29-
// create an extended `Vue` constructor
30-
const localVue = createLocalVue()
34+
// create an extended `Vue` constructor
35+
const localVue = createLocalVue()
3136

32-
// install a plugin “globally” on the “local” Vue constructor
33-
localVue.use(MyPlugin)
37+
// install a plugin “globally” on the “local” Vue constructor
38+
localVue.use(MyPlugin)
3439

35-
// pass the `localVue` to the mount options
36-
mount(Component, { localVue })
37-
```
40+
// pass the `localVue` to the mount options
41+
mount(Component, { localVue })
42+
```
3843

3944
- Global configuration makes it difficult to share the same copy of Vue between multiple "apps" on the same page, but with different global configurations.
4045

src/guide/migration/inline-template-attribute.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
types:
2+
badges:
33
- breaking
4-
- removal
54
---
65

7-
# Inline Template Attribute
6+
# Inline Template Attribute <MigrationBadges :badges="$frontmatter.badges" />
87

98
## Overview
109

@@ -68,7 +67,7 @@ A component previously using `inline-template` can also be refactored using the
6867
</my-comp>
6968
```
7069

71-
The child, instead of providing no template, should now render the default slot*:
70+
The child, instead of providing no template, should now render the default slot\*:
7271

7372
```html
7473
<!--
@@ -80,4 +79,4 @@ The child, instead of providing no template, should now render the default slot*
8079
</template>
8180
```
8281

83-
> * Note: In 3.x, slots can be rendered as the root with native [fragments](/guide/migration/fragments) support!
82+
> - Note: In 3.x, slots can be rendered as the root with native [fragments](/guide/migration/fragments) support!

src/guide/migration/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ The following consists a list of breaking changes from 2.x:
3939
- `v-enter` -> `v-enter-from`
4040
- `v-leave` -> `v-leave-from`
4141
- [Component watch option](/api/options-data.html#watch) and [instance method `$watch`](/api/instance-methods.html#watch) no longer supports dot-delimited string paths, use a computed function as the parameter instead
42+
- In Vue 2.x, application root container's `outerHTML` is replaced with root component template (or eventually compiled to a template, if root component has no template/render option). Vue 3.x now uses application container's `innerHTML` instead.
4243

4344
### Removed
4445

src/guide/migration/keycode-modifiers.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# KeyCode Modifiers
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# KeyCode Modifiers <MigrationBadges :badges="$frontmatter.badges" />
27

38
## Overview
49

src/guide/migration/render-function-api.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Render Function API
1+
---
2+
badges:
3+
- breaking
4+
---
5+
6+
# Render Function API <MigrationBadges :badges="$frontmatter.badges" />
27

38
## Overview
49

0 commit comments

Comments
 (0)