Skip to content

Commit f6db6ef

Browse files
committed
Merge branch 'master' of https://github.com/vuejs/docs-next
2 parents 49a4563 + 37ba7d2 commit f6db6ef

29 files changed

+556
-119
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"vuepress": "^1.5.4"
66
},
77
"scripts": {
8+
"dev": "yarn serve",
89
"serve": "vuepress dev src",
910
"build": "vuepress build src"
1011
},
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<script>
2+
export default {
3+
props: {
4+
href: {
5+
type: String,
6+
required: true
7+
},
8+
title: {
9+
type: String,
10+
default: ''
11+
}
12+
}
13+
}
14+
</script>
15+
16+
<template>
17+
<section class="video-lesson">
18+
<a :href="href" target="_blank" rel="sponsored noopener" :title="title">
19+
<slot></slot>
20+
</a>
21+
</section>
22+
</template>
23+
24+
<style lang="scss">
25+
.video-lesson {
26+
display: flex;
27+
align-items: center;
28+
background-color: #e7ecf3;
29+
padding: 1em 1.25em;
30+
border-radius: 2px;
31+
color: #486491;
32+
position: relative;
33+
margin: 24px 0;
34+
35+
a {
36+
color: #486491;
37+
position: relative;
38+
padding-left: 16px;
39+
}
40+
41+
&::before {
42+
content: '\f144';
43+
font-family: 'FontAwesome';
44+
font-size: 2em;
45+
display: inline-block;
46+
color: #73abfe;
47+
vertical-align: middle;
48+
}
49+
}
50+
</style>

src/.vuepress/components/common/vuemastery-video-modal.vue

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<template>
22
<div class="overlay" v-show="isOpen">
33
<div ref="modal" class="modal" :class="{ open: isOpen }">
4-
<div class="video-space" style="padding: 56.25% 0 0 0; position: relative;">
4+
<div
5+
class="video-space"
6+
style="padding: 56.25% 0 0 0; position: relative;"
7+
>
58
<iframe
69
src="https://player.vimeo.com/video/455611549?dnt=1"
710
style="height: 100%; left: 0; position: absolute; top: 0; width: 100%; margin: 0"
811
frameborder="0"
912
webkitallowfullscreen
1013
mozallowfullscreen
1114
allowfullscreen
15+
allow="autoplay"
1216
ref="videoIframe"
1317
></iframe>
1418
</div>
@@ -20,14 +24,15 @@
2024
target="_blank"
2125
rel="sponsored noopener"
2226
title="Vue.js Courses on Vue Mastery"
23-
>Vue Mastery</a>.
24-
Watch Vue Mastery’s free
27+
>Vue Mastery</a
28+
>. Watch Vue Mastery’s free
2529
<a
2630
href="https://www.vuemastery.com/courses/intro-to-vue-3/intro-to-vue3"
2731
target="_blank"
2832
rel="sponsored noopener"
2933
title="Vue.js Courses on Vue Mastery"
30-
>Intro to Vue course</a>.
34+
>Intro to Vue course</a
35+
>.
3136
</p>
3237
</div>
3338
</div>
@@ -47,7 +52,7 @@ export default {
4752
}),
4853
4954
methods: {
50-
initVideoModal () {
55+
initVideoModal() {
5156
const modalButton = document.querySelector(this.triggerSelector)
5257
const player = new Vimeo.Player(this.$refs.videoIframe)
5358
@@ -59,7 +64,11 @@ export default {
5964
})
6065
6166
document.body.addEventListener('click', event => {
62-
if (this.isOpen && event.target !== modalButton && !this.$refs.modal.contains(event.target)) {
67+
if (
68+
this.isOpen &&
69+
event.target !== modalButton &&
70+
!this.$refs.modal.contains(event.target)
71+
) {
6372
this.isOpen = false
6473
document.body.classList.remove('stop-scroll')
6574
player.pause()
@@ -68,7 +77,7 @@ export default {
6877
}
6978
},
7079
71-
mounted () {
80+
mounted() {
7281
if (typeof window !== 'undefined') {
7382
this.initVideoModal()
7483
}
@@ -77,7 +86,7 @@ export default {
7786
</script>
7887

7988
<style lang="scss">
80-
@import "@theme/styles/_settings.scss";
89+
@import '@theme/styles/_settings.scss';
8190
8291
.modal {
8392
box-sizing: border-box;

src/.vuepress/config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ const sidebar = {
107107
]
108108
},
109109
{
110-
title: 'Migration from Vue 2',
110+
title: 'Migration Guide',
111111
collapsable: true,
112112
children: [
113113
'migration/introduction',
114+
'migration/array-refs',
114115
'migration/async-components',
115116
'migration/attribute-coercion',
116117
'migration/custom-directives',
@@ -125,10 +126,13 @@ const sidebar = {
125126
'migration/inline-template-attribute',
126127
'migration/key-attribute',
127128
'migration/keycode-modifiers',
129+
'migration/props-default-this',
128130
'migration/render-function-api',
129131
'migration/slots-unification',
130132
'migration/transition',
131-
'migration/v-model'
133+
'migration/v-model',
134+
'migration/v-if-v-for',
135+
'migration/v-bind'
132136
]
133137
},
134138
{
@@ -235,6 +239,10 @@ module.exports = {
235239
text: 'Guide',
236240
link: '/guide/introduction'
237241
},
242+
{
243+
text: 'Migration Guide',
244+
link: '/guide/migration/introduction'
245+
},
238246
{
239247
text: 'Style Guide',
240248
link: '/style-guide/'
@@ -280,7 +288,7 @@ module.exports = {
280288
text: 'Official Projects',
281289
items: [{
282290
text: 'Vue Router',
283-
link: 'https://router.vuejs.org/'
291+
link: 'https://next.router.vuejs.org/'
284292
},
285293
{
286294
text: 'Vuex',
@@ -292,7 +300,7 @@ module.exports = {
292300
},
293301
{
294302
text: 'Vue Test Utils',
295-
link: 'https://vue-test-utils.vuejs.org/'
303+
link: 'https://vuejs.github.io/vue-test-utils-next-docs/guide/introduction.html'
296304
},
297305
{
298306
text: 'Devtools',

src/.vuepress/styles/index.styl

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,6 @@
125125
}
126126
}
127127

128-
.scrimba,
129-
.vueschool {
130-
background-color: #e7ecf3;
131-
padding: 1em 1.25em;
132-
border-radius: 2px;
133-
color: #486491;
134-
position: relative;
135-
margin: 24px 0;
136-
137-
a {
138-
color: #486491;
139-
position: relative;
140-
padding-left :16px;
141-
}
142-
143-
&::before {
144-
content: "\f144";
145-
font-family: 'FontAwesome';
146-
font-size: 2em;
147-
display: inline-block;
148-
color: #73abfe;
149-
vertical-align: middle;
150-
}
151-
}
152-
153128
.sidebar-group.is-sub-group > .sidebar-heading:not(.clickable) {
154129
font-size: inherit;
155130
cursor: pointer!important;

src/api/computed-watch-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function watchEffect(
6565
): StopHandle
6666
6767
interface WatchEffectOptions {
68-
flush?: 'pre' | 'post' | 'sync'
68+
flush?: 'pre' | 'post' | 'sync' // default: 'pre'
6969
onTrack?: (event: DebuggerEvent) => void
7070
onTrigger?: (event: DebuggerEvent) => void
7171
}

src/api/global-api.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,16 @@ const AsyncComp = defineAsyncComponent({
192192
// The error component will be displayed if a timeout is
193193
// provided and exceeded. Default: Infinity.
194194
timeout: 3000,
195-
// A function that returns a boolean indicating whether the async component should retry when the loader promise rejects
196-
retryWhen: error => error.code !== 404,
197-
// Maximum allowed retries number
198-
maxRetries: 3,
199195
// Defining if component is suspensible
200-
suspensible: false
196+
suspensible: false,
197+
/**
198+
*
199+
* @param {*} error Error message object
200+
* @param {*} retry A function that indicating whether the async component should retry when the loader promise rejects
201+
* @param {*} fail End of failure
202+
* @param {*} attempts Maximum allowed retries number
203+
*/
204+
onError(error, retry, fail, attempts) {},
201205
})
202206
```
203207

src/api/options-assets.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@
88

99
A hash of directives to be made available to the component instance.
1010

11+
- **Usage:**
12+
```js
13+
const app = Vue.createApp({})
14+
15+
app.component('focused-input', {
16+
directives: {
17+
focus: {
18+
mounted(el) {
19+
el.focus()
20+
}
21+
}
22+
},
23+
template: `<input v-focus>`
24+
})
25+
```
26+
1127
- **See also:** [Custom Directives](../guide/custom-directive.html)
1228

1329
## components
@@ -18,4 +34,18 @@
1834

1935
A hash of components to be made available to the component instance.
2036

37+
- **Usage:**
38+
```js
39+
const Foo = {
40+
template: `<div>Foo</div>`
41+
}
42+
43+
const app = Vue.createApp({
44+
components: {
45+
Foo
46+
},
47+
template: `<Foo />`
48+
})
49+
```
50+
2151
- **See also:** [Components](../guide/component-basics.html)

src/api/special-attributes.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ For example:
6363
```html
6464
<!-- component changes when currentView changes -->
6565
<component :is="currentView"></component>
66-
67-
For detailed usage, follow the links in the description above.
6866
```
6967

7068
- **See also:**

src/guide/component-custom-events.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ For these reasons, we recommend you **always use kebab-case for event names**.
2323

2424
## Defining Custom Events
2525

26+
<VideoLesson href="https://vueschool.io/lessons/defining-custom-events-emits?friend=vuejs" title="Learn how to define which events a component can emit with Vue School">Watch a free video about Defining Custom Events on Vue School</VideoLesson>
27+
2628
Emitted events can be defined on the component via the `emits` option.
2729

2830
```js

0 commit comments

Comments
 (0)