diff --git a/packages-private/dts-test/defineComponent.test-d.tsx b/packages-private/dts-test/defineComponent.test-d.tsx index 1967668dceb..9dc5bf87135 100644 --- a/packages-private/dts-test/defineComponent.test-d.tsx +++ b/packages-private/dts-test/defineComponent.test-d.tsx @@ -2107,3 +2107,38 @@ defineComponent({ expectType(this.$props) }, }) + +// #14117 +defineComponent({ + setup() { + const setup1 = ref('setup1') + const setup2 = ref('setup2') + return { setup1, setup2 } + }, + data() { + return { + data1: 1, + } + }, + props: { + props1: { + type: String, + }, + }, + methods: { + methods1() { + return `methods1` + }, + }, + computed: { + computed1() { + this.setup1 + this.setup2 + this.data1 + this.props1 + this.methods1() + return `computed1` + }, + }, + expose: ['setup1'], +}) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 68155e831a3..e83715f6a39 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -272,7 +272,7 @@ export function defineComponent< Slots, LocalComponents, Directives, - Exposed + string > >, ): DefineComponent< diff --git a/packages/runtime-core/src/componentOptions.ts b/packages/runtime-core/src/componentOptions.ts index 35f2f0cfaf5..fc41b04a9d4 100644 --- a/packages/runtime-core/src/componentOptions.ts +++ b/packages/runtime-core/src/componentOptions.ts @@ -1194,7 +1194,7 @@ export type ComponentOptionsWithoutProps< S, LC, Directives, - Exposed + string > > @@ -1256,7 +1256,7 @@ export type ComponentOptionsWithArrayProps< S, LC, Directives, - Exposed + string > >