mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
51 lines
964 B
TypeScript
51 lines
964 B
TypeScript
import { Component, Element, Prop } from '@stencil/core';
|
|
import { Config } from '../../index';
|
|
|
|
@Component({
|
|
tag: 'ion-app',
|
|
styleUrls: {
|
|
ios: 'app.ios.scss',
|
|
md: 'app.md.scss'
|
|
},
|
|
host: {
|
|
theme: 'app'
|
|
}
|
|
})
|
|
export class App {
|
|
|
|
private isDevice = false;
|
|
private deviceHacks = false;
|
|
|
|
@Element() el: HTMLElement;
|
|
|
|
@Prop({ context: 'config' }) config: Config;
|
|
|
|
componentWillLoad() {
|
|
this.isDevice = this.config.getBoolean('isDevice', false);
|
|
this.deviceHacks = this.config.getBoolean('deviceHacks', false);
|
|
}
|
|
|
|
testing() {}
|
|
|
|
hostData() {
|
|
const mode = this.config.get('mode');
|
|
const hoverCSS = this.config.getBoolean('hoverCSS', false);
|
|
|
|
return {
|
|
class: {
|
|
[mode]: true,
|
|
'enable-hover': hoverCSS
|
|
}
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return [
|
|
this.deviceHacks && <ion-input-shims />,
|
|
<ion-tap-click />,
|
|
this.isDevice && <ion-status-tap />,
|
|
<slot></slot>
|
|
];
|
|
}
|
|
}
|