File tree 2 files changed +21
-2
lines changed
test/unit/features/global-api
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -379,10 +379,10 @@ export function mergeOptions (
379
379
normalizeInject ( child , vm )
380
380
normalizeDirectives ( child )
381
381
const extendsFrom = child . extends
382
- if ( extendsFrom ) {
382
+ if ( extendsFrom && ! child . _base ) {
383
383
parent = mergeOptions ( parent , extendsFrom , vm )
384
384
}
385
- if ( child . mixins ) {
385
+ if ( child . mixins && ! child . _base ) {
386
386
for ( let i = 0 , l = child . mixins . length ; i < l ; i ++ ) {
387
387
parent = mergeOptions ( parent , child . mixins [ i ] , vm )
388
388
}
Original file line number Diff line number Diff line change @@ -71,6 +71,25 @@ describe('Global API: extend', () => {
71
71
expect ( calls ) . toEqual ( [ 1 , 2 , 3 ] )
72
72
} )
73
73
74
+ it ( 'should not merge nested mixins' , ( ) => {
75
+ const A = Vue . extend ( {
76
+ created : ( ) => { }
77
+ } )
78
+ const B = Vue . extend ( {
79
+ mixins : [ A ] ,
80
+ created : ( ) => { }
81
+ } )
82
+ const C = Vue . extend ( {
83
+ extends : B ,
84
+ created : ( ) => { }
85
+ } )
86
+ const D = Vue . extend ( {
87
+ mixins : [ C ] ,
88
+ created : ( ) => { }
89
+ } )
90
+ expect ( D . options . created . length ) . toBe ( 4 )
91
+ } )
92
+
74
93
it ( 'should merge methods' , ( ) => {
75
94
const A = Vue . extend ( {
76
95
methods : {
You can’t perform that action at this time.
0 commit comments