diff --git a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap index 12d5a67db7e..1044b0e167c 100644 --- a/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap @@ -320,3 +320,22 @@ return { rest } }" `; + +exports[`sfc reactive props destructure > with TSInstantiationExpression 1`] = ` +"import { defineComponent as _defineComponent } from 'vue' +type Foo = (data: T) => void + +export default /*@__PURE__*/_defineComponent({ + props: { + value: { type: Function } + }, + setup(__props: any) { + + + const foo = __props.value<123> + +return () => {} +} + +})" +`; diff --git a/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts b/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts index 106e469f188..50602eb59bc 100644 --- a/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts @@ -198,6 +198,21 @@ describe('sfc reactive props destructure', () => { }`) }) + test('with TSInstantiationExpression', () => { + const { content } = compile( + ` + + `, + { isProd: true }, + ) + assertCode(content) + expect(content).toMatch(`const foo = __props.value<123>`) + }) + test('aliasing', () => { const { content, bindings } = compile(`