File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -672,7 +672,8 @@ export function cloneVNode<T, U>(
672
672
ssFallback : vnode . ssFallback && cloneVNode ( vnode . ssFallback ) ,
673
673
el : vnode . el ,
674
674
anchor : vnode . anchor ,
675
- ctx : vnode . ctx
675
+ ctx : vnode . ctx ,
676
+ ce : vnode . ce
676
677
}
677
678
if ( __COMPAT__ ) {
678
679
defineLegacyVNodeProperties ( cloned as VNode )
Original file line number Diff line number Diff line change @@ -384,6 +384,25 @@ describe('defineCustomElement', () => {
384
384
detail : [ 1 ]
385
385
} )
386
386
} )
387
+ // #7293
388
+ test ( 'emit in an async component wrapper with properties bound' , async ( ) => {
389
+ const E = defineCustomElement (
390
+ defineAsyncComponent (
391
+ ( ) => new Promise < typeof CompDef > ( res => res ( CompDef as any ) )
392
+ )
393
+ )
394
+ customElements . define ( 'my-async-el-props-emits' , E )
395
+ container . innerHTML = `<my-async-el-props-emits id="my_async_el_props_emits"></my-async-el-props-emits>`
396
+ const e = container . childNodes [ 0 ] as VueElement
397
+ const spy = jest . fn ( )
398
+ e . addEventListener ( 'my-click' , spy )
399
+ await customElements . whenDefined ( 'my-async-el-props-emits' )
400
+ e . shadowRoot ! . childNodes [ 0 ] . dispatchEvent ( new CustomEvent ( 'click' ) )
401
+ expect ( spy ) . toHaveBeenCalled ( )
402
+ expect ( spy . mock . calls [ 0 ] [ 0 ] ) . toMatchObject ( {
403
+ detail : [ 1 ]
404
+ } )
405
+ } )
387
406
} )
388
407
389
408
describe ( 'slots' , ( ) => {
You can’t perform that action at this time.
0 commit comments