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) {
3434 ) ( )
3535 ChildVue . options = BaseCtor . options
3636 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
3840 ctors [ BaseCtor . cid ] = ChildVue
3941 }
4042 } else {
Original file line number Diff line number Diff line change @@ -287,6 +287,36 @@ describe('Content Transclusion', function () {
287287 } )
288288 } )
289289
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+
290320 it ( 'single content outlet with replace: true' , function ( ) {
291321 vm = new Vue ( {
292322 el : el ,
You can’t perform that action at this time.
0 commit comments