chore: optimize initDefaultProps type
parent
d96a10dce8
commit
d0429737bd
|
@ -1,3 +1,4 @@
|
||||||
|
import { PropType } from 'vue';
|
||||||
import { VueTypeValidableDef, VueTypeDef } from 'vue-types';
|
import { VueTypeValidableDef, VueTypeDef } from 'vue-types';
|
||||||
|
|
||||||
const initDefaultProps = <T>(
|
const initDefaultProps = <T>(
|
||||||
|
@ -7,6 +8,8 @@ const initDefaultProps = <T>(
|
||||||
? U
|
? U
|
||||||
: T[K] extends VueTypeDef<infer U>
|
: T[K] extends VueTypeDef<infer U>
|
||||||
? U
|
? U
|
||||||
|
: T[K] extends { type: PropType<infer U> }
|
||||||
|
? U
|
||||||
: any;
|
: any;
|
||||||
},
|
},
|
||||||
): T => {
|
): T => {
|
||||||
|
|
Loading…
Reference in New Issue