File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ if (_.inBrowser) {
148148 template : '<div v-component="test" v-show="ok">{{message}}</div>' ,
149149 components : {
150150 test : {
151- template : '<content></content> {{message}}' ,
151+ template : '<div><content></content> {{message}}</div>' ,
152+ replace : true ,
152153 data : function ( ) {
153154 return {
154155 message : 'world'
Original file line number Diff line number Diff line change @@ -225,6 +225,36 @@ if (_.inBrowser) {
225225 expect ( el . innerHTML ) . toBe ( markup + '<!--v-repeat-->' )
226226 } )
227227
228+ it ( 'component + parent directive + transclusion' , function ( done ) {
229+ var vm = new Vue ( {
230+ el : el ,
231+ template : '<div v-repeat="list" v-component="test" v-class="cls">{{msg}}</div>' ,
232+ data : {
233+ cls : 'parent' ,
234+ msg : 'hi' ,
235+ list : [ { a :1 } , { a :2 } , { a :3 } ]
236+ } ,
237+ components : {
238+ test : {
239+ replace : true ,
240+ template : '<div class="child">{{a}} <content></content></div>'
241+ }
242+ }
243+ } )
244+ var markup = vm . list . map ( function ( item ) {
245+ return '<div class="child parent">' + item . a + ' hi</div>'
246+ } ) . join ( '' )
247+ expect ( el . innerHTML ) . toBe ( markup + '<!--v-repeat-->' )
248+ vm . msg = 'ho'
249+ markup = vm . list . map ( function ( item ) {
250+ return '<div class="child parent">' + item . a + ' ho</div>'
251+ } ) . join ( '' )
252+ _ . nextTick ( function ( ) {
253+ expect ( el . innerHTML ) . toBe ( markup + '<!--v-repeat-->' )
254+ done ( )
255+ } )
256+ } )
257+
228258 it ( 'array filters' , function ( done ) {
229259 var vm = new Vue ( {
230260 el : el ,
You can’t perform that action at this time.
0 commit comments