mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(): update to Stencil One 🎉🎊
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Component, ComponentInterface } from '@stencil/core';
|
||||
import { Component, ComponentInterface, h } from '@stencil/core';
|
||||
|
||||
import { Mode } from '../../interface';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-avatar',
|
||||
@ -11,12 +11,13 @@ import { Mode } from '../../interface';
|
||||
shadow: true
|
||||
})
|
||||
export class Avatar implements ComponentInterface {
|
||||
mode!: Mode;
|
||||
|
||||
hostData() {
|
||||
const mode = getIonMode(this);
|
||||
|
||||
return {
|
||||
class: {
|
||||
[`${this.mode}`]: true,
|
||||
[`${mode}`]: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -37,10 +37,10 @@ Avatars can be used by themselves or inside of any element. If placed inside of
|
||||
|
||||
```tsx
|
||||
import React from 'react'
|
||||
import { IonAvatar, IonChip, IonItem, IonLabel } from '@ionic/react';
|
||||
import { IonAvatar, IonChip, IonItem, IonLabel, IonContent } from '@ionic/react';
|
||||
|
||||
const AvatarExample: React.SFC<{}> = () => (
|
||||
<>
|
||||
export const AvatarExample: React.FunctionComponent = () => (
|
||||
<IonContent>
|
||||
<IonAvatar>
|
||||
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
|
||||
</IonAvatar>
|
||||
@ -58,10 +58,8 @@ const AvatarExample: React.SFC<{}> = () => (
|
||||
</IonAvatar>
|
||||
<IonLabel>Item Avatar</IonLabel>
|
||||
</IonItem>
|
||||
</>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default AvatarExample;
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script src="../../../../../dist/ionic.js"></script>
|
||||
</head>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script src="../../../../../dist/ionic.js"></script>
|
||||
</head>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<link href="../../../../../css/core.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script src="../../../../../dist/ionic.js"></script>
|
||||
</head>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>
|
||||
|
||||
<body class="ion-padding">
|
||||
<h1>Default</h1>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
```tsx
|
||||
import React from 'react'
|
||||
import { IonAvatar, IonChip, IonItem, IonLabel } from '@ionic/react';
|
||||
import { IonAvatar, IonChip, IonItem, IonLabel, IonContent } from '@ionic/react';
|
||||
|
||||
const AvatarExample: React.SFC<{}> = () => (
|
||||
<>
|
||||
export const AvatarExample: React.FunctionComponent = () => (
|
||||
<IonContent>
|
||||
<IonAvatar>
|
||||
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
|
||||
</IonAvatar>
|
||||
@ -21,8 +21,6 @@ const AvatarExample: React.SFC<{}> = () => (
|
||||
</IonAvatar>
|
||||
<IonLabel>Item Avatar</IonLabel>
|
||||
</IonItem>
|
||||
</>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default AvatarExample;
|
||||
```
|
||||
Reference in New Issue
Block a user