Skip to content

Commit eb95383

Browse files
committed
minor tweaks
1 parent c61ed2a commit eb95383

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/directives/prop.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@ module.exports = {
2929
)
3030

3131
// set the child initial value.
32-
// !!! We need to set it also on raw data here, because
33-
// props are initialized before data is fully observed
3432
var value = this.parentWatcher.value
3533
if (childKey === '$data') {
3634
child._data = value
3735
} else {
3836
_.initProp(child, prop, value)
3937
}
4038

41-
// only setup two-way binding if this is not a one-way
42-
// binding.
39+
// setup two-way binding
4340
if (prop.mode === bindingModes.TWO_WAY) {
4441
// important: defer the child watcher creation until
4542
// the created hook (after data observation)
@@ -57,9 +54,7 @@ module.exports = {
5754
},
5855

5956
unbind: function () {
60-
if (this.parentWatcher) {
61-
this.parentWatcher.teardown()
62-
}
57+
this.parentWatcher.teardown()
6358
if (this.childWatcher) {
6459
this.childWatcher.teardown()
6560
}

0 commit comments

Comments
 (0)