Pārlūkot izejas kodu

props: fix two-way prop setter on dynamic paths (fix #1378)

Evan You 10 gadi atpakaļ
vecāks
revīzija
2f0945b0ea
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      src/directives/internal/prop.js

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

@@ -17,6 +17,7 @@ module.exports = {
     var prop = this.descriptor.prop
     var childKey = prop.path
     var parentKey = prop.parentPath
+    var twoWay = prop.mode === bindingModes.TWO_WAY
 
     var parentWatcher = this.parentWatcher = new Watcher(
       parent,
@@ -26,6 +27,7 @@ module.exports = {
           child[childKey] = val
         }
       }, {
+        twoWay: twoWay,
         filters: prop.filters,
         // important: props need to be observed on the
         // v-for scope if present
@@ -37,7 +39,7 @@ module.exports = {
     _.initProp(child, prop, parentWatcher.value)
 
     // setup two-way binding
-    if (prop.mode === bindingModes.TWO_WAY) {
+    if (twoWay) {
       // important: defer the child watcher creation until
       // the created hook (after data observation)
       var self = this