|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
/*
|
|
|
- Vue.js v0.10.1
|
|
|
|
|
|
|
+ Vue.js v0.10.2
|
|
|
(c) 2014 Evan You
|
|
(c) 2014 Evan You
|
|
|
License: MIT
|
|
License: MIT
|
|
|
*/
|
|
*/
|
|
@@ -1658,7 +1658,7 @@ CompilerProto.getOption = function (type, id, silent) {
|
|
|
? parent.getOption(type, id, silent)
|
|
? parent.getOption(type, id, silent)
|
|
|
: globalAssets[type] && globalAssets[type][id]
|
|
: globalAssets[type] && globalAssets[type][id]
|
|
|
)
|
|
)
|
|
|
- if (!res && !silent) {
|
|
|
|
|
|
|
+ if (!res && !silent && typeof id === 'string') {
|
|
|
utils.warn('Unknown ' + type.slice(0, -1) + ': ' + id)
|
|
utils.warn('Unknown ' + type.slice(0, -1) + ': ' + id)
|
|
|
}
|
|
}
|
|
|
return res
|
|
return res
|
|
@@ -3831,7 +3831,6 @@ module.exports = {
|
|
|
ctn.insertBefore(this.ref, el)
|
|
ctn.insertBefore(this.ref, el)
|
|
|
ctn.removeChild(el)
|
|
ctn.removeChild(el)
|
|
|
|
|
|
|
|
- this.initiated = false
|
|
|
|
|
this.collection = null
|
|
this.collection = null
|
|
|
this.vms = null
|
|
this.vms = null
|
|
|
|
|
|
|
@@ -3847,13 +3846,6 @@ module.exports = {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // if initiating with an empty collection, we need to
|
|
|
|
|
- // force a compile so that we get all the bindings for
|
|
|
|
|
- // dependency extraction.
|
|
|
|
|
- if (!this.initiated && (!collection || !collection.length)) {
|
|
|
|
|
- this.dryBuild()
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// keep reference of old data and VMs
|
|
// keep reference of old data and VMs
|
|
|
// so we can reuse them if possible
|
|
// so we can reuse them if possible
|
|
|
this.oldVMs = this.vms
|
|
this.oldVMs = this.vms
|
|
@@ -3871,24 +3863,6 @@ module.exports = {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * Run a dry build just to collect bindings
|
|
|
|
|
- */
|
|
|
|
|
- dryBuild: function () {
|
|
|
|
|
- var el = this.el.cloneNode(true),
|
|
|
|
|
- Ctor = this.compiler.resolveComponent(el)
|
|
|
|
|
- new Ctor({
|
|
|
|
|
- el : el,
|
|
|
|
|
- parent : this.vm,
|
|
|
|
|
- data : { $index: 0 },
|
|
|
|
|
- compilerOptions: {
|
|
|
|
|
- repeat: true,
|
|
|
|
|
- expCache: this.expCache
|
|
|
|
|
- }
|
|
|
|
|
- }).$destroy()
|
|
|
|
|
- this.initiated = true
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
init: function (collection, isObject) {
|
|
init: function (collection, isObject) {
|
|
|
var vm, vms = []
|
|
var vm, vms = []
|
|
|
for (var i = 0, l = collection.length; i < l; i++) {
|
|
for (var i = 0, l = collection.length; i < l; i++) {
|
|
@@ -3949,7 +3923,9 @@ module.exports = {
|
|
|
// second pass, collect old reused and destroy unused
|
|
// second pass, collect old reused and destroy unused
|
|
|
for (i = 0, l = oldVMs.length; i < l; i++) {
|
|
for (i = 0, l = oldVMs.length; i < l; i++) {
|
|
|
vm = oldVMs[i]
|
|
vm = oldVMs[i]
|
|
|
- item = vm.$data
|
|
|
|
|
|
|
+ item = this.arg
|
|
|
|
|
+ ? vm.$data[this.arg]
|
|
|
|
|
+ : vm.$data
|
|
|
if (item.$reused) {
|
|
if (item.$reused) {
|
|
|
vm.$reused = true
|
|
vm.$reused = true
|
|
|
delete item.$reused
|
|
delete item.$reused
|
|
@@ -3964,7 +3940,9 @@ module.exports = {
|
|
|
vms[vm.$index] = vm
|
|
vms[vm.$index] = vm
|
|
|
} else {
|
|
} else {
|
|
|
// this one can be destroyed.
|
|
// this one can be destroyed.
|
|
|
- delete item.__emitter__[this.identifier]
|
|
|
|
|
|
|
+ if (item.__emitter__) {
|
|
|
|
|
+ delete item.__emitter__[this.identifier]
|
|
|
|
|
+ }
|
|
|
vm.$destroy()
|
|
vm.$destroy()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -4035,8 +4013,10 @@ module.exports = {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- // attach an ienumerable identifier
|
|
|
|
|
- data.__emitter__[this.identifier] = true
|
|
|
|
|
|
|
+ if (isObject) {
|
|
|
|
|
+ // attach an ienumerable identifier to the raw data
|
|
|
|
|
+ (raw || data).__emitter__[this.identifier] = true
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (wrap) {
|
|
if (wrap) {
|
|
|
var self = this,
|
|
var self = this,
|