ts
wy勇敢的心
爱好技术学习!希望共同的学习进步!目标是做一个全栈的攻城狮哈哈!!!!
展开
-
ts 定义对象的常用方式
//通过接口定义相应的结构interface Item { name: string, icon: string, url: string, status:boolean, initShow:boolean, copanyStatus:boolean}interface IPlist{ title:string, list:Item[]}const menusList:IPlist[] =[{ title: '集团分析', .原创 2021-09-08 16:14:06 · 5177 阅读 · 0 评论 -
ts 常用的内置类型Readonly,Pick,Partial,Required,Returntype,和使用场景,让你不一样
常用的使用类型 Pick(挑选)<Type,keys>Omit<Type,keys>(不保留) Partial(可选) Required<Type>Readonly<Type>(只读) ReturnType<Type>(返回类型构建一个类型)type UserPer = { name: string age: number hobies: number[]}type addUserPer = Partial<.原创 2021-09-06 15:59:26 · 1046 阅读 · 0 评论