diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index b167dea7026..ae42d6f87b9 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -1784,6 +1784,29 @@ const props = __props as { foo: string, bar?: number, baz: boolean, qux(): numbe +return { props } +} + +})" +`; + +exports[`SFC compile + `, + { isProd: true } + ) + assertCode(content) + expect(content).toMatch(`const props = __props`) + + // foo has no default value, the Function can be dropped + expect(content).toMatch(`foo: null`) + expect(content).toMatch(`bar: { type: Boolean }`) + expect(content).toMatch( + `baz: { type: [Boolean, Function], default: true }` + ) + expect(content).toMatch(`qux: { default: 'hi' }`) + }) + test('withDefaults (dynamic)', () => { const { content } = compile(`