0
点赞
收藏
分享

微信扫一扫

ts重点学习124-参数的装饰器笔记


// export default {}

function paramDecorator(target: any, key: string, index: number) {
console.log(target);
console.log(key);
console.log(index);

}

class Test {
getInfo( name: string, @paramDecorator age: number) {
console.log(name, age);

}
}

let t = new Test();
t.getInfo("安悦溪", 18);

举报

相关推荐

0 条评论