Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

Commit a8191d8

Browse files
authored
Merge pull request #150 from vuejs/docs-video
docs: add migration videoLesson
2 parents f21e17a + f4d4c55 commit a8191d8

File tree

6 files changed

+60
-25
lines changed

6 files changed

+60
-25
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.3.0"
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/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/guide/component-custom-events.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ this.$emit('myEvent')
2323

2424
## 定义自定义事件
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">在 Vue School 上观看关于定义自定义事件的免费视频。</VideoLesson>
27+
2628
可以通过 `emits` 选项在组件上定义已发出的事件。
2729

2830
```js

src/guide/composition-api-introduction.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
在阅读文档之前,你应该已经熟悉了这两个 [Vue 基础](introduction.md)[创建组件](component-basics.md)
77
:::
88

9+
<VideoLesson href="https://www.vuemastery.com/courses/vue-3-essentials/why-the-composition-api" title="Learn how Composition API works in depth with Vue Mastery">在 Vue Mastery 上观看关于组合 API 的免费视频。</VideoLesson>
10+
911
通过创建 Vue 组件,我们可以将接口的可重复部分及其功能提取到可重用的代码段中。仅此一项就可以使我们的应用程序在可维护性和灵活性方面走得更远。然而,我们的经验已经证明,光靠这一点可能是不够的,尤其是当你的应用程序变得非常大的时候——想想几百个组件。在处理如此大的应用程序时,共享和重用代码变得尤为重要。
1012

1113
假设在我们的应用程序中,我们有一个视图来显示某个用户的仓库列表。除此之外,我们还希望应用搜索和筛选功能。处理此视图的组件可能如下所示:
@@ -67,6 +69,9 @@ export default {
6769

6870
### `setup` 组件选项
6971

72+
<VideoLesson href="https://www.vuemastery.com/courses/vue-3-essentials/setup-and-reactive-references" title="Learn how setup works with Vue Mastery">观看 Vue Mastery 上的免费 setup 视频。</VideoLesson>
73+
74+
7075
新的 `setup` 组件选项在**创建组件之前**执行,一旦 `props` 被解析,并充当合成 API 的入口点。
7176

7277
:::warning

src/guide/reactivity.md

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

33
现在是时候深入了!Vue 最独特的特性之一,是其非侵入性的响应性系统。数据模型是被代理的 JavaScript 对象。而当你修改它们时,视图会进行更新。这让状态管理非常简单直观,不过理解其工作原理同样重要,这样你可以避开一些常见的问题。在这个章节,我们将研究一下 Vue 响应性系统的底层的细节。
44

5+
<VideoLesson href="https://www.vuemastery.com/courses/vue-3-reactivity/vue3-reactivity" title="Learn how how reactivity works in depth with Vue Mastery">在 Vue Mastery 上免费观看关于深入响应性原理的视频。</VideoLesson>
6+
57
## 什么是响应性
68

79
这个术语在程序设计中经常被提及,但这是什么意思呢?响应性是一种允许我们以声明式的方式去适应变化的一种编程范例。人们通常展示的典型例子,是一份 excel 电子表格 (一个非常好的例子)。

0 commit comments

Comments
 (0)