随笔分类 - 前端歌谣ts-学习-2022
前端ts-学习-2022
摘要:export default {}; /* const userInfo: any = undefined; class Test { getName() { try{ return userInfo.name }catch(e) { console.log(e); } } getAge() { t
阅读全文
摘要:// export default {} function paramDecorator(target: any, key: string, index: number) { console.log(target); console.log(key); console.log(index); } c
阅读全文
摘要:export default {} /* function nameDecorator(target: any, key: string) { console.log(target); console.log(key); } class Test { @nameDecorator uname = "
阅读全文
摘要:export default {} function visitDecorator(target: any, key: string, descritor: PropertyDescriptor) { // console.log(target); // console.log(key); // c
阅读全文
摘要:export default {} // 普通方法: target对应的就是 prototype // 静态方法: target对应的就是 类的构造函数 function getNameDecorator(target: any, key: string, desciptor: PropertyDe
阅读全文
摘要:export default {}; /* function testDecorator(constructor: any) { constructor.prototype.uname = "张予曦"; constructor.prototype.show = ():void => { consol
阅读全文