File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
test/unit/specs/element-directives Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ exports.$addChild = function (opts, BaseCtor) {
34
34
) ( )
35
35
ChildVue . options = BaseCtor . options
36
36
ChildVue . linker = BaseCtor . linker
37
- ChildVue . prototype = this
37
+ // important: transcluded inline repeaters should
38
+ // inherit from outer scope rather than host
39
+ ChildVue . prototype = opts . _context || this
38
40
ctors [ BaseCtor . cid ] = ChildVue
39
41
}
40
42
} else {
Original file line number Diff line number Diff line change @@ -287,6 +287,36 @@ describe('Content Transclusion', function () {
287
287
} )
288
288
} )
289
289
290
+ // #1010
291
+ it ( 'v-repeat inside transcluded content' , function ( ) {
292
+ vm = new Vue ( {
293
+ el : el ,
294
+ template :
295
+ '<testa>' +
296
+ '{{inner}} {{outer}}' +
297
+ '<div v-repeat="list"> {{inner}} {{outer}}</div>' +
298
+ '</testa>' ,
299
+ data : {
300
+ outer : 'outer' ,
301
+ inner : 'parent-inner' ,
302
+ list : [
303
+ { inner : 'list-inner' }
304
+ ]
305
+ } ,
306
+ components : {
307
+ testa : {
308
+ data : function ( ) {
309
+ return {
310
+ inner : 'component-inner'
311
+ }
312
+ } ,
313
+ template : '<content></content>'
314
+ }
315
+ }
316
+ } )
317
+ expect ( el . textContent ) . toBe ( 'parent-inner outer list-inner outer' )
318
+ } )
319
+
290
320
it ( 'single content outlet with replace: true' , function ( ) {
291
321
vm = new Vue ( {
292
322
el : el ,
You can’t perform that action at this time.
0 commit comments