Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c9c1f35

Browse files
fix
1 parent f630ff0 commit c9c1f35

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

‎src/v2/guide/instance.md‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ vm.$watch('a', function (newVal, oldVal) {
7979

8080
## 实例生命周期
8181

82-
<<<<<<< HEAD
83-
每个 Vue 实例在被创建之前都要经过一系列的初始化过程。例如,实例需要配置数据观测(data observer)、编译模版、挂载实例到 DOM ,然后在数据变化时更新 DOM 。在这个过程中,实例也会调用一些 **生命周期钩子** ,这就给我们提供了执行自定义逻辑的机会。例如,`created` 这个钩子在实例被创建之后被调用:
84-
=======
85-
Each Vue instance goes through a series of initialization steps when it is created - for example, it needs to set up data observation, compile the template, mount the instance to the DOM, and update the DOM when data changes. Along the way, it will also invoke some **lifecycle hooks**, which give us the opportunity to execute custom logic. For example, the [`created`](../api/#created) hook is called after the instance is created:
86-
>>>>>>> vuejs.org-master
82+
每个 Vue 实例在被创建之前都要经过一系列的初始化过程。例如,实例需要配置数据观测(data observer)、编译模版、挂载实例到 DOM ,然后在数据变化时更新 DOM 。在这个过程中,实例也会调用一些 **生命周期钩子** ,这就给我们提供了执行自定义逻辑的机会。例如,[`created`](../api/#created) 这个钩子在实例被创建之后被调用:
8783

8884
``` js
8985
var vm = new Vue({
@@ -98,12 +94,7 @@ var vm = new Vue({
9894
// -> "a is: 1"
9995
```
10096

101-
<<<<<<< HEAD
102-
也有一些其它的钩子,在实例生命周期的不同阶段调用,如 `mounted``updated``destroyed` 。钩子的 `this` 指向调用它的 Vue 实例。一些用户可能会问 Vue.js 是否有"控制器"的概念?答案是,没有。组件的自定义逻辑可以分布在这些钩子中。
103-
104-
=======
105-
There are also other hooks which will be called at different stages of the instance's lifecycle, for example [`mounted`](../api/#mounted), [`updated`](../api/#updated), and [`destroyed`](../api/#destroyed). All lifecycle hooks are called with their `this` context pointing to the Vue instance invoking it. You may have been wondering where the concept of "controllers" lives in the Vue world and the answer is: there are no controllers. Your custom logic for a component would be split among these lifecycle hooks.
106-
>>>>>>> vuejs.org-master
97+
也有一些其它的钩子,在实例生命周期的不同阶段调用,如 [`mounted`](../api/#mounted), [`updated`](../api/#updated), and [`destroyed`](../api/#destroyed) 。钩子的 `this` 指向调用它的 Vue 实例。一些用户可能会问 Vue.js 是否有"控制器"的概念?答案是,没有。组件的自定义逻辑可以分布在这些钩子中。
10798

10899
## 生命周期图示
109100

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /