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 {
Label,
......@@ -50,7 +50,8 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
cw: number;
ch: number;
constructor() {
constructor(private appRef: ApplicationRef,
private changeDetectorRef: ChangeDetectorRef) {
super();
}
......@@ -101,6 +102,9 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
}
this.init();
this.initWithData();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
// @ts-ignore
if (window['air']) {
// @ts-ignore
......@@ -278,9 +282,14 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
// }, 10);
this.cw = this.previewContainer.nativeElement.offsetWidth;
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