mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
perf(platform): remove from critical path
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
import { Component, Element, Listen, Prop, State } from '@stencil/core';
|
||||
import { Config, PlatformConfig } from '../../index';
|
||||
import { Config } from '../../index';
|
||||
|
||||
import {
|
||||
DisplayWhen,
|
||||
updateTestResults,
|
||||
DisplayWhen, PLATFORM_CONFIGS, PlatformConfig, detectPlatforms, updateTestResults,
|
||||
} from '../../utils/show-hide-when-utils';
|
||||
|
||||
@Component({
|
||||
@ -12,22 +11,29 @@ import {
|
||||
})
|
||||
export class HideWhen implements DisplayWhen {
|
||||
|
||||
calculatedPlatforms: PlatformConfig[];
|
||||
|
||||
@Element() element: HTMLElement;
|
||||
@Prop({ context: 'config' }) config: Config;
|
||||
@Prop({ context: 'platforms' }) calculatedPlatforms: PlatformConfig[];
|
||||
@Prop({ context: 'window'}) win: Window;
|
||||
|
||||
@Prop() orientation: string|undefined;
|
||||
@Prop() mediaQuery: string|undefined;
|
||||
@Prop() size: string|undefined;
|
||||
@Prop() mode: string|undefined;
|
||||
@Prop() platform: string|undefined;
|
||||
@Prop() orientation: string;
|
||||
@Prop() mediaQuery: string;
|
||||
@Prop() size: string;
|
||||
@Prop() mode: string;
|
||||
@Prop() platform: string;
|
||||
@Prop() or = false;
|
||||
|
||||
@State() passesTest = false;
|
||||
|
||||
@Listen('window:resize')
|
||||
componentWillLoad() {
|
||||
return updateTestResults(this);
|
||||
this.calculatedPlatforms = detectPlatforms(this.win, PLATFORM_CONFIGS);
|
||||
this.onResize();
|
||||
}
|
||||
|
||||
@Listen('window:resize')
|
||||
onResize() {
|
||||
updateTestResults(this);
|
||||
}
|
||||
|
||||
hostData() {
|
||||
|
Reference in New Issue
Block a user