随笔分类 - ts知识总结
摘要:vue3 、typescript环境, props自定义类型propType //子组件的props类型是复杂的类型的时候,可以用propType进行强制类型转换 //eg 复杂函数,对象数组,对象的类型检查 props: { callback: { type: Function as PropTy
阅读全文
摘要:ts(keyof,typeof) keyof 获取某类型的键,返回联合类型 interface Person { hair: string; eyesColor: string; } let P1 = keyof; Penson; //"hair"||'eyesColor' //特别 type K3
阅读全文