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

Commit 1dad978

Browse files
authored
Merge pull request #148 from GeekQiaQia/master
docs: composition-api-lifecycle-hooks.md
2 parents 03c03f0 + d2814c3 commit 1dad978

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/guide/composition-api-lifecycle-hooks.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
> 本指南假定你已经阅读了 [Composition API 简介](composition-api-introduction.html)[响应式基础](reactivity-fundamentals.html)。如果你不熟悉组合 API,请先阅读这篇文章。
44
5-
你可以通过在生命周期钩子前面加上“on”来访问组件的生命周期钩子。
5+
<VideoLesson href="https://www.vuemastery.com/courses/vue-3-essentials/lifecycle-hooks" title="Learn about how Lifecycle Hooks work with Vue Mastery">在 Vue Mastery 上观看关于生命周期钩子的免费视频</VideoLesson>
6+
7+
你可以通过在生命周期钩子前面加上 “on” 来访问组件的生命周期钩子。
68

79
下表包含如何在 [setup ()](composition-api-setup.html) 内部调用生命周期钩子:
810

9-
| 选项 API | Hook inside inside `setup` |
11+
| 选项 API | Hook inside `setup` |
1012
| ----------------- | -------------------------- |
1113
| `beforeCreate` | Not needed\* |
1214
| `created` | Not needed\* |
@@ -24,7 +26,7 @@
2426
因为 `setup` 是围绕 `beforeCreate``created` 生命周期钩子运行的,所以不需要显式地定义它们。换句话说,在这些钩子中编写的任何代码都应该直接在 `setup` 函数中编写。
2527
:::
2628

27-
这些函数接受在组件调用钩子时将执行的回调:
29+
这些函数接受一个回调函数,当钩子被组件调用时将会被执行:
2830

2931
```js
3032
// MyBook.vue

0 commit comments

Comments
 (0)