Преглед изворни кода

support two-way filter for two-way props

Evan You пре 10 година
родитељ
комит
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 childKey = prop.path
     var parentKey = prop.parentPath
     var parentKey = prop.parentPath
 
 
-    this.parentWatcher = new Watcher(
+    var parentWatcher = this.parentWatcher = new Watcher(
       parent,
       parent,
       parentKey,
       parentKey,
       function (val) {
       function (val) {
@@ -34,7 +34,7 @@ module.exports = {
     )
     )
 
 
     // set the child initial value.
     // set the child initial value.
-    _.initProp(child, prop, this.parentWatcher.value)
+    _.initProp(child, prop, parentWatcher.value)
 
 
     // setup two-way binding
     // setup two-way binding
     if (prop.mode === bindingModes.TWO_WAY) {
     if (prop.mode === bindingModes.TWO_WAY) {
@@ -46,7 +46,7 @@ module.exports = {
           child,
           child,
           childKey,
           childKey,
           function (val) {
           function (val) {
-            parent.$set(parentKey, val)
+            parentWatcher.set(val)
           }
           }
         )
         )
       })
       })