摘要: 阅读全文
posted @ 2022-09-30 20:41 前端导师歌谣 阅读(31) 评论(0) 推荐(0)
摘要: export default {} // Required<Type> // 构建一个由 Type 的所有属性组成的类型,设置为必填。与 Partial 相反 interface IPerson { name?: string; age?: number; } let res: IPerson = 阅读全文
posted @ 2022-09-30 20:41 前端导师歌谣 阅读(29) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(29) 评论(0) 推荐(0)
摘要: export default {} /* function nameDecorator(target: any, key: string) { console.log(target); console.log(key); } class Test { @nameDecorator uname = " 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(29) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(26) 评论(0) 推荐(0)
摘要: export default {} function visitDecorator(target: any, key: string, descritor: PropertyDescriptor) { // console.log(target); // console.log(key); // c 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(50) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(25) 评论(0) 推荐(0)
摘要: export default {} // 普通方法: target对应的就是 prototype // 静态方法: target对应的就是 类的构造函数 function getNameDecorator(target: any, key: string, desciptor: PropertyDe 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(27) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(21) 评论(0) 推荐(0)
摘要: 工厂函数 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(19) 评论(0) 推荐(0)