+30
-2
lines changedFilter options
+30
-2
lines changed Original file line number Diff line number Diff line change
@@ -382,13 +382,13 @@ export function mergeOptions (
382
382
}
383
383
384
384
if (typeof child === 'function') {
385
-
child = child.options
385
+
child = child.extendOptions
386
386
}
387
387
388
388
normalizeProps(child, vm)
389
389
normalizeInject(child, vm)
390
390
normalizeDirectives(child)
391
-
391
+
392
392
// Apply extends and mixins on the child options,
393
393
// but only if it is a raw options object that isn't
394
394
// the result of another mergeOptions call.
Original file line number Diff line number Diff line change
@@ -109,4 +109,32 @@ describe('Options mixins', () => {
109
109
expect(vm.b).toBeDefined()
110
110
expect(vm.$options.directives.c).toBeDefined()
111
111
})
112
+
113
+
it('should not mix global mixined lifecycle hook twice', () => {
114
+
const spy = jasmine.createSpy('global mixed in lifecycle hook')
115
+
Vue.mixin({
116
+
created() {
117
+
spy()
118
+
}
119
+
})
120
+
121
+
const mixin1 = Vue.extend({
122
+
methods: {
123
+
a() {}
124
+
}
125
+
})
126
+
127
+
const mixin2 = Vue.extend({
128
+
mixins: [mixin1],
129
+
})
130
+
131
+
const Child = Vue.extend({
132
+
mixins: [mixin2],
133
+
})
134
+
135
+
const vm = new Child()
136
+
137
+
expect(typeof vm.$options.methods.a).toBe('function')
138
+
expect(spy.calls.count()).toBe(1)
139
+
})
112
140
})
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4