From 638e5a948fda1542fdab61a9575238ebfce4d7c8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Thu, 24 Sep 2020 10:13:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84window.onresize=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/working-area.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index ec7586b..9b21638 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -188,7 +188,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV }); // 测试代码 this.eventManager.addGlobalEventListener('window', 'keypress', (event: any) => { - + }); // setTimeout(() => { // this.createCanvas(); @@ -197,9 +197,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV ngAfterViewInit(): void { this.createCanvas(); - let that = this - window.onresize = function(){ - that.resizeCanvas() + window.onresize = () => { + this.resizeCanvas(); }; } /**