|
|
|
|
@ -64,7 +64,6 @@ vue初始化做了什么?
@@ -64,7 +64,6 @@ vue初始化做了什么?
|
|
|
|
|
|
|
|
|
|
--> 销毁完毕,调用destroyed:销毁之后,所有的事件监听器会被移除,所有的子实例也都会被销毁 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
子组件的生命周期 |
|
|
|
|
<!DOCTYPE html> |
|
|
|
|
<html lang="en"> |
|
|
|
|
@ -151,7 +150,7 @@ vue初始化做了什么?
@@ -151,7 +150,7 @@ vue初始化做了什么?
|
|
|
|
|
父 --> created |
|
|
|
|
|
|
|
|
|
父 --> beforemount |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
子 --> beforeCreate |
|
|
|
|
|
|
|
|
|
子 --> created |
|
|
|
|
@ -159,9 +158,9 @@ vue初始化做了什么?
@@ -159,9 +158,9 @@ vue初始化做了什么?
|
|
|
|
|
子 --> beforeMount |
|
|
|
|
|
|
|
|
|
子 --> mounted |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
父 --> mounted |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
复制代码 |
|
|
|
|
有v-if控制子组件的显示和隐藏。 |
|
|
|
|
|
|
|
|
|
@ -180,7 +179,7 @@ v-if初始值为false,在父组件的(mounted)生命周期将变为true时,顺
@@ -180,7 +179,7 @@ v-if初始值为false,在父组件的(mounted)生命周期将变为true时,顺
|
|
|
|
|
父 --> mounted |
|
|
|
|
|
|
|
|
|
父 --> beforeUpdate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
子 --> beforeCreate |
|
|
|
|
|
|
|
|
|
子 --> created |
|
|
|
|
@ -222,6 +221,7 @@ v-show初始值为false,在父组件的(mounted)生命周期将变为true时,
@@ -222,6 +221,7 @@ v-show初始值为false,在父组件的(mounted)生命周期将变为true时,
|
|
|
|
|
|
|
|
|
|
复制代码 |
|
|
|
|
孙组件的生命周期 |
|
|
|
|
|
|
|
|
|
```html |
|
|
|
|
<!DOCTYPE html> |
|
|
|
|
<html lang="en"> |
|
|
|
|
|