diff --git a/types/test/v3/define-component-test.tsx b/types/test/v3/define-component-test.tsx index 42d0f32eb0d..481a2d11ac7 100644 --- a/types/test/v3/define-component-test.tsx +++ b/types/test/v3/define-component-test.tsx @@ -1165,3 +1165,7 @@ defineComponent({ return h('div', {}, [...this.$slots.default!]) } }) + +// #12742 allow attaching custom properties (consistent with v3) +const Foo = defineComponent({}) +Foo.foobar = 123 diff --git a/types/v3-component-options.d.ts b/types/v3-component-options.d.ts index d8c64ab13ab..e2da34e753f 100644 --- a/types/v3-component-options.d.ts +++ b/types/v3-component-options.d.ts @@ -88,6 +88,9 @@ export interface ComponentOptionsBase< 'data' | 'computed' | 'methods' | 'setup' | 'props' | 'mixins' | 'extends' >, ComponentCustomOptions { + // allow any options + [key: string]: any + // rewrite options api types data?: ( this: CreateComponentPublicInstance,