interface environment {
    a: string
}

let obj:environment = {
   a: 'xxx'
}

function test( this: {}, arg:string ) {
    console.log(this.a()); // xxx
};

//调用:
test.call(obj, 'xxx');

 

 posted on 2024-02-08 14:59  laremehpe  阅读(5)  评论(0编辑  收藏  举报