Просмотр исходного кода

support two-way filter for two-way props

Evan You 10 лет назад
Родитель
Сommit
6f112ff8c3
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/directives/internal/prop.js

+ 3 - 3
src/directives/internal/prop.js

@@ -18,7 +18,7 @@ module.exports = {
     var childKey = prop.path
     var parentKey = prop.parentPath
 
-    this.parentWatcher = new Watcher(
+    var parentWatcher = this.parentWatcher = new Watcher(
       parent,
       parentKey,
       function (val) {
@@ -34,7 +34,7 @@ module.exports = {
     )
 
     // set the child initial value.
-    _.initProp(child, prop, this.parentWatcher.value)
+    _.initProp(child, prop, parentWatcher.value)
 
     // setup two-way binding
     if (prop.mode === bindingModes.TWO_WAY) {
@@ -46,7 +46,7 @@ module.exports = {
           child,
           childKey,
           function (val) {
-            parent.$set(parentKey, val)
+            parentWatcher.set(val)
           }
         )
       })