diff --git a/packages/runtime-dom/__tests__/customElement.spec.ts b/packages/runtime-dom/__tests__/customElement.spec.ts
index ab4d6f47939..1ed7cc25311 100644
--- a/packages/runtime-dom/__tests__/customElement.spec.ts
+++ b/packages/runtime-dom/__tests__/customElement.spec.ts
@@ -408,6 +408,9 @@ describe('defineCustomElement', () => {
onMousedown: () => {
emit('myEvent', 1) // validate hyphenation
},
+ onWheel: () => {
+ emit('my-wheel', { bubbles: true }, 1)
+ },
})
},
})
@@ -467,6 +470,7 @@ describe('defineCustomElement', () => {
detail: [1],
})
})
+
// #7293
test('emit in an async component wrapper with properties bound', async () => {
const E = defineCustomElement(
@@ -488,6 +492,19 @@ describe('defineCustomElement', () => {
detail: [1],
})
})
+
+ test('emit with options', async () => {
+ container.innerHTML = `
= { @@ -405,9 +412,12 @@ export class VueElement extends BaseClass { const dispatch = (event: string, args: any[]) => { this.dispatchEvent( - new CustomEvent(event, { - detail: args, - }), + new CustomEvent( + event, + isPlainObject(args[0]) + ? extend({ detail: args }, args[0]) + : { detail: args }, + ), ) }