mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
32 lines
669 B
TypeScript
32 lines
669 B
TypeScript
import type { ComponentInterface } from '@stencil/core';
|
|
import { Component, Host, h } from '@stencil/core';
|
|
|
|
import { getIonTheme } from '../../global/ionic-global';
|
|
|
|
/**
|
|
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the appearance of components.
|
|
*/
|
|
@Component({
|
|
tag: 'ion-avatar',
|
|
styleUrls: {
|
|
ios: 'avatar.ios.scss',
|
|
md: 'avatar.md.scss',
|
|
ionic: 'avatar.md.scss',
|
|
},
|
|
shadow: true,
|
|
})
|
|
export class Avatar implements ComponentInterface {
|
|
render() {
|
|
const theme = getIonTheme(this);
|
|
return (
|
|
<Host
|
|
class={{
|
|
[theme]: true,
|
|
}}
|
|
>
|
|
<slot></slot>
|
|
</Host>
|
|
);
|
|
}
|
|
}
|