فهرست منبع

Update index.js

Splice too much?
qinghong.sheng 11 سال پیش
والد
کامیت
05207a3c2e
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/observer/index.js

+ 2 - 2
src/observer/index.js

@@ -181,7 +181,7 @@ p.convert = function (key, val) {
       var oldChildOb = val && val.__ob__
       if (oldChildOb) {
         var oldBindings = oldChildOb.bindings
-        oldBindings.splice(oldBindings.indexOf(binding))
+        oldBindings.splice(oldBindings.indexOf(binding),1)
       }
       val = newVal
       // add binding to new value
@@ -232,4 +232,4 @@ p.removeVm = function (vm) {
   this.vms.splice(this.vms.indexOf(vm), 1)
 }
 
-module.exports = Observer
+module.exports = Observer