File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -269,4 +269,48 @@ describe('Misc', function () {
269269 } )
270270 expect ( hasWarned ( __ , 'Unknown custom element' ) ) . toBe ( true )
271271 } )
272+
273+ it ( 'prefer bound title over static title' , function ( done ) {
274+ var el = document . createElement ( 'div' )
275+ var count = 0
276+ var expected = [
277+ 'bound' ,
278+ 'bound' ,
279+ 'static' ,
280+ 'bound' ,
281+ 'bound'
282+ ]
283+ function check ( title ) {
284+ expect ( title ) . toBe ( expected [ count ] )
285+ count ++
286+ if ( count === 4 ) {
287+ done ( )
288+ }
289+ }
290+
291+ document . body . appendChild ( el )
292+
293+ new Vue ( {
294+ el : el ,
295+ template :
296+ '<div>\
297+ <comp v-bind:title="title"></comp>\
298+ <comp title="static" v-bind:title="title"></comp>\
299+ <comp title="static"></comp>\
300+ <comp :title="title"></comp>\
301+ <comp title="static" :title="title"></comp>\
302+ </div>' ,
303+ data : {
304+ title : 'bound'
305+ } ,
306+ components : {
307+ comp : {
308+ props : [ 'title' ] ,
309+ ready : function ( ) {
310+ check ( this . title )
311+ }
312+ }
313+ }
314+ } )
315+ } )
272316} )
You can’t perform that action at this time.
0 commit comments