1. // 原型,方法名,参数所在的位置
    2. function paramDecorator(target: any, method: string, paramIndex: number) {
    3. console.log(target, method, paramIndex);
    4. }
    5. class Test {
    6. getInfo(name: string, @paramDecorator age: number) {
    7. console.log(name, age);
    8. }
    9. }
    10. const test = new Test();
    11. test.getInfo('Dell', 30);