Skip to content

Commit f127ccb

Browse files
committed
dryBuild is no longer necessary in v-repeat
1 parent 0faf0e6 commit f127ccb

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

src/compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ CompilerProto.getOption = function (type, id, silent) {
836836
? parent.getOption(type, id, silent)
837837
: globalAssets[type] && globalAssets[type][id]
838838
)
839-
if (!res && !silent) {
839+
if (!res && !silent && typeof id === 'string') {
840840
utils.warn('Unknown ' + type.slice(0, -1) + ': ' + id)
841841
}
842842
return res

src/directives/repeat.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module.exports = {
2525
ctn.insertBefore(this.ref, el)
2626
ctn.removeChild(el)
2727

28-
this.initiated = false
2928
this.collection = null
3029
this.vms = null
3130

@@ -41,13 +40,6 @@ module.exports = {
4140
}
4241
}
4342

44-
// if initiating with an empty collection, we need to
45-
// force a compile so that we get all the bindings for
46-
// dependency extraction.
47-
if (!this.initiated && (!collection || !collection.length)) {
48-
this.dryBuild()
49-
}
50-
5143
// keep reference of old data and VMs
5244
// so we can reuse them if possible
5345
this.oldVMs = this.vms
@@ -65,24 +57,6 @@ module.exports = {
6557

6658
},
6759

68-
/**
69-
* Run a dry build just to collect bindings
70-
*/
71-
dryBuild: function () {
72-
var el = this.el.cloneNode(true),
73-
Ctor = this.compiler.resolveComponent(el)
74-
new Ctor({
75-
el : el,
76-
parent : this.vm,
77-
data : { $index: 0 },
78-
compilerOptions: {
79-
repeat: true,
80-
expCache: this.expCache
81-
}
82-
}).$destroy()
83-
this.initiated = true
84-
},
85-
8660
init: function (collection, isObject) {
8761
var vm, vms = []
8862
for (var i = 0, l = collection.length; i < l; i++) {

0 commit comments

Comments
 (0)