Skip to content

Commit 92ea37c

Browse files
committed
observe
1 parent 4ddcb8d commit 92ea37c

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

1.0.21/src/compiler/compile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ function linkAndCapture (linker, vm) {
112112
var dirs = vm._directives.slice(originalDirCount)
113113
dirs.sort(directiveComparator)
114114
for (var i = 0, l = dirs.length; i < l; i++) {
115+
// 触发创建 watcher 实例的地方
115116
dirs[i]._bind()
116117
}
117118
return dirs

1.0.21/src/instance/api/lifecycle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default function (Vue) {
2424
if (!el) {
2525
el = document.createElement('div')
2626
}
27+
// 这里开始编译模板
2728
this._compile(el)
2829
this._initDOMHooks()
2930
if (inDoc(this.$el)) {

1.0.21/src/observer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Observer.prototype.walk = function (obj) {
8686

8787
Observer.prototype.observeArray = function (items) {
8888
for (var i = 0, l = items.length; i < l; i++) {
89-
obsezrve(items[i])
89+
observe(items[i])
9090
}
9191
}
9292

0 commit comments

Comments
 (0)