Commit fc92f063 authored by liujiaxin's avatar liujiaxin

www

parent 86e1c35f
import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, AfterViewInit } from '@angular/core'; import { ApplicationRef, ChangeDetectorRef,Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, AfterViewInit } from '@angular/core';
import { import {
Label, Label,
...@@ -50,7 +50,8 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV ...@@ -50,7 +50,8 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
cw: number; cw: number;
ch: number; ch: number;
constructor() { constructor(private appRef: ApplicationRef,
private changeDetectorRef: ChangeDetectorRef) {
super(); super();
} }
...@@ -101,6 +102,9 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV ...@@ -101,6 +102,9 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
} }
this.init(); this.init();
this.initWithData(); this.initWithData();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
// @ts-ignore // @ts-ignore
if (window['air']) { if (window['air']) {
// @ts-ignore // @ts-ignore
...@@ -278,9 +282,14 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV ...@@ -278,9 +282,14 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
// }, 10); // }, 10);
this.cw = this.previewContainer.nativeElement.offsetWidth; this.cw = this.previewContainer.nativeElement.offsetWidth;
this.ch = this.previewContainer.nativeElement.offsetHeight; this.ch = this.previewContainer.nativeElement.offsetHeight;
this.refresh();
}); });
} }
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment