摘要: // export default {} function paramDecorator(target: any, key: string, index: number) { console.log(target); console.log(key); console.log(index); } c 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(25) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(28) 评论(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 前端导师歌谣 阅读(22) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(25) 评论(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 前端导师歌谣 阅读(43) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(24) 评论(0) 推荐(0)
摘要: export default {} // 普通方法: target对应的就是 prototype // 静态方法: target对应的就是 类的构造函数 function getNameDecorator(target: any, key: string, desciptor: PropertyDe 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(21) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(21) 评论(0) 推荐(0)
摘要: export default {}; /* function testDecorator(constructor: any) { constructor.prototype.uname = "张予曦"; constructor.prototype.show = ():void => { consol 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(19) 评论(0) 推荐(0)
摘要: 工厂函数 阅读全文
posted @ 2022-09-30 20:40 前端导师歌谣 阅读(18) 评论(0) 推荐(0)