Skip to content

Commit b550e92

Browse files
committed
chore: 新增配置合并、生命周期、组件注册和异步组件学习html文件,并完善配置合并过程中相关流程代码注释说明
1 parent d36e4cf commit b550e92

File tree

12 files changed

+271
-49
lines changed

12 files changed

+271
-49
lines changed

Diff for: .vscode/bookmarks.json

+29-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
"line": 20,
7373
"column": 48,
7474
"label": "Vue静态成员的初始化"
75+
},
76+
{
77+
"line": 64,
78+
"column": 35,
79+
"label": "Vue.options开始初始化位置"
7580
}
7681
]
7782
},
@@ -94,17 +99,22 @@
9499
"label": "Vue.prototype._init方法"
95100
},
96101
{
97-
"line": 75,
102+
"line": 42,
103+
"column": 24,
104+
"label": "子组件初始化过程中的 配置合并"
105+
},
106+
{
107+
"line": 77,
98108
"column": 32,
99109
"label": "beforeCreate 生命周期钩子触发位置"
100110
},
101111
{
102-
"line": 84,
112+
"line": 86,
103113
"column": 27,
104114
"label": "created 生命周期钩子触发位置"
105115
},
106116
{
107-
"line": 97,
117+
"line": 99,
108118
"column": 31,
109119
"label": "调用 vm.$mount 将用户传入的 el 属性替换渲染为真实 DOM"
110120
}
@@ -327,16 +337,31 @@
327337
"line": 58,
328338
"column": 50,
329339
"label": "Vue中关于js组合继承的用法"
340+
},
341+
{
342+
"line": 66,
343+
"column": 22,
344+
"label": "子组件定义过程中的 配置合并"
330345
}
331346
]
332347
},
333348
{
334349
"path": "src/core/util/options.js",
335350
"bookmarks": [
336351
{
337-
"line": 286,
352+
"line": 132,
353+
"column": 52,
354+
"label": "子组件实例的 data 属性必须是函数,否则会报错出处"
355+
},
356+
{
357+
"line": 312,
338358
"column": 9,
339359
"label": "Do not use built-in or reserved HTML elements as component 报错出处"
360+
},
361+
{
362+
"line": 418,
363+
"column": 30,
364+
"label": "mergeOptions函数出处"
340365
}
341366
]
342367
},

Diff for: dist/vue.js

+71-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: examples/00-vue-analysis/09-merge-config.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>09-merge-config</title>
7+
</head>
8+
<body>
9+
<h1>09-merge-config</h1>
10+
<script>
11+
// 示例参看 examples/vue-cli-vue2.6-project 工程!
12+
// 相关注释也在工程中注明了!
13+
// 1.外部调用场景下的合并配置是通过 mergeOptions(位置在:src\core\util\options.js) ,并遵循一定的合并策略
14+
// 2.组件合并是通过initInternalComponent,它的合并更快
15+
// 3.框架、库的设计都是类似,自身定义了默认配置,同时可以在初始化阶段传入配置,然后merge配置,来达到定制化不同需求的目的
16+
</script>
17+
</body>
18+
</html>

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

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>10-lifecycle</title>
7+
</head>
8+
<body>
9+
<h1>10-lifecycle</h1>
10+
<script>
11+
// 示例参看 examples/vue-cli-vue2.6-project 工程!
12+
// 相关注释也在工程中注明了!
13+
14+
</script>
15+
</body>
16+
</html>

Diff for: examples/00-vue-analysis/11-component.register.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>11-component.register</title>
7+
</head>
8+
<body>
9+
<h1>11-component.register</h1>
10+
<script>
11+
// 示例参看 examples/vue-cli-vue2.6-project 工程!
12+
// 相关注释也在工程中注明了!
13+
14+
</script>
15+
</body>
16+
</html>

0 commit comments

Comments
 (0)