From: edison Date: Sun, 5 Sep 2021 22:10:15 +0000 (+0800) Subject: fix(compiler-sfc): support using declared interface in normal script with defineProps... X-Git-Tag: v3.2.9~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14d65181f1610079f0d9969c214720624056106b;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): support using declared interface in normal script with defineProps() (#4522) fix #4423 --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 430b2993f6..4292327ca6 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -866,6 +866,26 @@ export default /*#__PURE__*/_defineComponent({ +return { } +} + +})" +`; + +exports[`SFC compile + + `) + assertCode(content) + expect(content).toMatch(`x: { type: Number, required: false }`) + expect(bindings).toStrictEqual({ + x: BindingTypes.PROPS + }) + }) + test('defineProps w/ type alias', () => { const { content, bindings } = compile(`