Browse Source

make sure to use own $key in uncacheVm (fix #948)

Evan You 11 years ago
parent
commit
b5cdc279ec
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/directives/repeat.js

+ 3 - 1
src/directives/repeat.js

@@ -502,7 +502,9 @@ module.exports = {
     var data = vm._raw
     var idKey = this.idKey
     var index = vm.$index
-    var key = vm.$key
+    // fix #948: avoid accidentally fall through to
+    // a parent repeater which happens to have $key.
+    var key = vm.hasOwnProperty('$key') && vm.$key
     var primitive = !isObject(data)
     if (idKey || key || primitive) {
       var id = idKey