Browse Source

v-bind: update v-model on same element when value bindings change

Evan You 10 years ago
parent
commit
f38fbc3680
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/directives/public/bind.js

+ 5 - 0
src/directives/public/bind.js

@@ -103,6 +103,11 @@ module.exports = {
     var modelProp = modelProps[attr]
     var modelProp = modelProps[attr]
     if (modelProp) {
     if (modelProp) {
       this.el[modelProp] = value
       this.el[modelProp] = value
+      // update v-model if present
+      var model = this.el.__v_model
+      if (model) {
+        model.listener()
+      }
     }
     }
   }
   }
 }
 }