diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 4292327c..54591d40 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -947,6 +947,7 @@ export default /*#__PURE__*/_defineComponent({ fn: { type: Function, required: true }, functionRef: { type: Function, required: true }, objectRef: { type: Object, required: true }, + dateTime: { type: Date, required: true }, array: { type: Array, required: true }, arrayRef: { type: Array, required: true }, tuple: { type: Array, required: true }, diff --git a/packages/compiler-sfc/__tests__/compileScript.spec.ts b/packages/compiler-sfc/__tests__/compileScript.spec.ts index 086a2bcf..854357b6 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -678,6 +678,7 @@ const emit = defineEmits(['a', 'b']) fn: (n: number) => void functionRef: Function objectRef: Object + dateTime: Date array: string[] arrayRef: Array tuple: [number, number] @@ -706,6 +707,7 @@ const emit = defineEmits(['a', 'b']) expect(content).toMatch(`fn: { type: Function, required: true }`) expect(content).toMatch(`functionRef: { type: Function, required: true }`) expect(content).toMatch(`objectRef: { type: Object, required: true }`) + expect(content).toMatch(`dateTime: { type: Date, required: true }`) expect(content).toMatch(`array: { type: Array, required: true }`) expect(content).toMatch(`arrayRef: { type: Array, required: true }`) expect(content).toMatch(`tuple: { type: Array, required: true }`) @@ -737,6 +739,7 @@ const emit = defineEmits(['a', 'b']) fn: BindingTypes.PROPS, functionRef: BindingTypes.PROPS, objectRef: BindingTypes.PROPS, + dateTime: BindingTypes.PROPS, array: BindingTypes.PROPS, arrayRef: BindingTypes.PROPS, tuple: BindingTypes.PROPS, diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 7d8acc67..523efd72 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1515,6 +1515,7 @@ function inferRuntimeType( case 'Map': case 'WeakSet': case 'WeakMap': + case 'Date': return [node.typeName.name] case 'Record': case 'Partial':