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);

posted @ 2022-09-30 20:40  前端导师歌谣  阅读(31)  评论(0)    收藏  举报