Skip to content

Commit e7cec78

Browse files
committed
chore: 调整生命周期示例
1 parent acb18a8 commit e7cec78

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: examples/00-vue-analysis/10-lifecycle.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h1>10-lifecycle</h1>
1010
<script>
1111
// 示例参看 examples/vue-cli-vue2.6-project 工程!
1212
// 相关注释也在工程中注明了!
13-
13+
// 1.通过分析可以知道,在 created 钩子函数中可以访问到数据,在 mounted 钩子函数中可以访问到 DOM,在 destroy 钩子函数中可以做一些定时器销毁工作
1414
</script>
1515
</body>
1616
</html>

Diff for: examples/vue-cli-vue2.6-project/src/components/HelloWorld.vue

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div class="hello">
3+
<MyTitle />
34
<h1>{{ msg }}</h1>
45
<h1>{{ desc }}</h1>
56
<p>
@@ -88,8 +89,13 @@
8889
</template>
8990

9091
<script>
92+
import MyTitle from './MyTitle.vue'
93+
9194
export default {
9295
name: "HelloWorld",
96+
components: {
97+
MyTitle
98+
},
9399
props: {
94100
msg: String,
95101
},

0 commit comments

Comments
 (0)