Skip to content

Commit 12ecbf7

Browse files
committed
fix asset merge logic
1 parent 641d3a9 commit 12ecbf7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/directives/repeat.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ module.exports = {
5858
},
5959

6060
/**
61-
* Check if v-ref/ v-el is also present. If yes, evaluate
62-
* them and locate owner.
61+
* Check if v-ref/ v-el is also present.
6362
*/
6463

6564
checkRef: function () {
65+
this.owner = this.vm._owner
6666
var childId = _.attr(this.el, 'ref')
6767
this.childId = childId
6868
? this.vm.$interpolate(childId)
@@ -71,9 +71,6 @@ module.exports = {
7171
this.elId = elId
7272
? this.vm.$interpolate(elId)
7373
: null
74-
if (this.childId || this.elId) {
75-
this.owner = this.vm._owner || this.vm
76-
}
7774
},
7875

7976
/**

src/util/merge-option.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,19 @@ strats.filters =
107107
strats.partials =
108108
strats.transitions =
109109
strats.components = function (parentVal, childVal, vm, key) {
110-
var ret = Object.create(parentVal || null)
110+
var ret = Object.create(
111+
vm && vm.$parent
112+
? vm.$parent.$options[key]
113+
: _.Vue.options[key]
114+
)
111115
if (childVal) extend(ret, childVal)
112-
if (vm && vm.$parent) {
113-
var scopeVal = vm.$parent.$options[key]
114-
var keys = Object.keys(scopeVal)
116+
if (parentVal) {
117+
var keys = Object.keys(parentVal)
115118
var i = keys.length
116119
var field
117120
while (i--) {
118121
field = keys[i]
119-
ret[field] = scopeVal[field]
122+
ret[field] = parentVal[field]
120123
}
121124
}
122125
return ret

0 commit comments

Comments
 (0)