From: edison Date: Wed, 26 Oct 2022 08:44:30 +0000 (+0800) Subject: fix(compiler-sfc): support using extends interface with defineProps() (#4512) X-Git-Tag: v3.2.42~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83f7e6f8a688e823274379fe79f58b90ea58892d;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): support using extends interface with defineProps() (#4512) fix #4498 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index b7fc9304b2..aa5e2d0492 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -1467,6 +1467,33 @@ export default /*#__PURE__*/_defineComponent({ +return { } +} + +})" +`; + +exports[`SFC compile + + `) + assertCode(content) + expect(content).toMatch(`z: { type: Number, required: true }`) + expect(content).toMatch(`y: { type: String, required: true }`) + expect(content).toMatch(`x: { type: Number, required: false }`) + expect(bindings).toStrictEqual({ + x: BindingTypes.PROPS, + y: BindingTypes.PROPS, + z: BindingTypes.PROPS + }) + }) + test('defineProps w/ exported interface', () => { const { content, bindings } = compile(`