File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
test/unit/features/directives Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,28 @@ describe('Directive v-once', () => {
335
335
vm . ok = false // teardown component with v-once
336
336
} ) . then ( done ) // should not throw
337
337
} )
338
+
339
+ // #6826
340
+ it ( 'should render different component instances properly' , done => {
341
+ const vm = new Vue ( {
342
+ components : {
343
+ foo : {
344
+ props : [ 'name' ] ,
345
+ template : '<div v-once>{{ name }}</div>'
346
+ }
347
+ } ,
348
+ template : `
349
+ <div>
350
+ <foo name="a" v-once></foo>
351
+ <foo name="b" v-once></foo>
352
+ </div>
353
+ `
354
+ } ) . $mount ( )
355
+ waitForUpdate ( ( ) => {
356
+ expect ( vm . $el . children [ 0 ] . innerHTML ) . toBe ( 'a' )
357
+ expect ( vm . $el . children [ 1 ] . innerHTML ) . toBe ( 'b' )
358
+ } ) . then ( done )
359
+ } )
338
360
} )
339
361
340
362
function expectTextContent ( vm , text ) {
You can’t perform that action at this time.
0 commit comments