File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ module.exports = {
27
27
this . linker = compiler . compile (
28
28
this . template ,
29
29
this . vm . $options ,
30
- true
30
+ true , // partial
31
+ this . _host // important
31
32
)
32
33
cache . put ( cacheId , this . linker )
33
34
}
Original file line number Diff line number Diff line change @@ -327,5 +327,33 @@ if (_.inBrowser) {
327
327
}
328
328
} )
329
329
330
+ // #1097 v-if components not having correct parent
331
+ it ( 'compile with correct transclusion host' , function ( ) {
332
+ var parentA
333
+ var parentB
334
+ new Vue ( {
335
+ el : el ,
336
+ data : {
337
+ show : true
338
+ } ,
339
+ template : '<parent><child v-if="show"></child></parent>' ,
340
+ components : {
341
+ parent : {
342
+ template : '<content></content>' ,
343
+ created : function ( ) {
344
+ parentA = this
345
+ }
346
+ } ,
347
+ child : {
348
+ created : function ( ) {
349
+ parentB = this . $parent
350
+ }
351
+ }
352
+ }
353
+ } )
354
+ expect ( parentA ) . toBeTruthy ( )
355
+ expect ( parentA ) . toBe ( parentB )
356
+ } )
357
+
330
358
} )
331
359
}
You can’t perform that action at this time.
0 commit comments