fix(compile-sfc): support Date
prop type with defineProps (#4519)
This commit is contained in:
parent
14d65181f1
commit
fac9a2926d
@ -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 },
|
||||
|
@ -678,6 +678,7 @@ const emit = defineEmits(['a', 'b'])
|
||||
fn: (n: number) => void
|
||||
functionRef: Function
|
||||
objectRef: Object
|
||||
dateTime: Date
|
||||
array: string[]
|
||||
arrayRef: Array<any>
|
||||
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,
|
||||
|
@ -1515,6 +1515,7 @@ function inferRuntimeType(
|
||||
case 'Map':
|
||||
case 'WeakSet':
|
||||
case 'WeakMap':
|
||||
case 'Date':
|
||||
return [node.typeName.name]
|
||||
case 'Record':
|
||||
case 'Partial':
|
||||
|
Loading…
Reference in New Issue
Block a user