Evan You 13 лет назад
Родитель
Сommit
ee09149e3b
2 измененных файлов с 4 добавлено и 3 удалено
  1. 1 1
      src/compiler.js
  2. 3 2
      src/viewmodel.js

+ 1 - 1
src/compiler.js

@@ -448,7 +448,7 @@ CompilerProto.bindContexts = function (bindings) {
  */
  */
 CompilerProto.destroy = function () {
 CompilerProto.destroy = function () {
     utils.log('compiler destroyed: ', this.vm.$el)
     utils.log('compiler destroyed: ', this.vm.$el)
-    var i, key, dir, inss, binding
+    var i, key, dir, inss, binding,
         directives = this.directives,
         directives = this.directives,
         bindings = this.bindings,
         bindings = this.bindings,
         el = this.el
         el = this.el

+ 3 - 2
src/viewmodel.js

@@ -18,8 +18,9 @@ var VMProto = ViewModel.prototype
  */
  */
 VMProto.$set = function (key, value) {
 VMProto.$set = function (key, value) {
     var path = key.split('.'),
     var path = key.split('.'),
-        level = 0, l = path.length - 1
-        target = this
+        l = path.length - 1,
+        target = this,
+        level = 0
     while (level < l) {
     while (level < l) {
         target = target[path[level]]
         target = target[path[level]]
         level++
         level++