diff --git a/packages/runtime-dom/__tests__/customElement.spec.ts b/packages/runtime-dom/__tests__/customElement.spec.ts
index 12d6f722057..d8aad9c0af1 100644
--- a/packages/runtime-dom/__tests__/customElement.spec.ts
+++ b/packages/runtime-dom/__tests__/customElement.spec.ts
@@ -342,6 +342,23 @@ describe('defineCustomElement', () => {
expect(el.maxAge).toBe(50)
expect(el.shadowRoot.innerHTML).toBe('max age: 50/type: number')
})
+
+ test('support direct setup function syntax with extra options', () => {
+ const E = defineCustomElement(
+ props => {
+ return () => props.text
+ },
+ {
+ props: {
+ text: String,
+ },
+ },
+ )
+ customElements.define('my-el-setup-with-props', E)
+ container.innerHTML = `
= {
// overload 1: direct setup function
export function defineCustomElement (
/*! #__NO_SIDE_EFFECTS__ */
export function defineCustomElement(
options: any,
+ extraOptions?: ComponentOptions,
+ /**
+ * @internal
+ */
hydrate?: RootHydrateFunction,
): VueElementConstructor {
- const Comp = defineComponent(options) as any
+ const Comp = defineComponent(options, extraOptions) as any
class VueCustomElement extends VueElement {
static def = Comp
constructor(initialProps?: Record