mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
fix(): update to Stencil One 🎉🎊
This commit is contained in:
@ -30,11 +30,10 @@ Thumbnails can be used by themselves or inside of any element. If placed inside
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { IonThumbnail, IonItem, IonLabel, IonContent } from '@ionic/react';
|
||||
|
||||
import { IonThumbnail, IonItem, IonLabel } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
export const ThumbnailExample: React.FunctionComponent = () => (
|
||||
<IonContent>
|
||||
<IonThumbnail>
|
||||
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
|
||||
</IonThumbnail>
|
||||
@ -45,10 +44,8 @@ const Example: React.SFC<{}> = () => (
|
||||
</IonThumbnail>
|
||||
<IonLabel>Item Thumbnail</IonLabel>
|
||||
</IonItem>
|
||||
</>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default Example;
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -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>
|
||||
<ion-thumbnail>
|
||||
|
||||
@ -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-thumbnail',
|
||||
@ -8,12 +8,12 @@ import { Mode } from '../../interface';
|
||||
shadow: true
|
||||
})
|
||||
export class Thumbnail implements ComponentInterface {
|
||||
mode!: Mode;
|
||||
|
||||
hostData() {
|
||||
const mode = getIonMode(this);
|
||||
return {
|
||||
class: {
|
||||
[`${this.mode}`]: true,
|
||||
[`${mode}`]: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { IonThumbnail, IonItem, IonLabel, IonContent } from '@ionic/react';
|
||||
|
||||
import { IonThumbnail, IonItem, IonLabel } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
export const ThumbnailExample: React.FunctionComponent = () => (
|
||||
<IonContent>
|
||||
<IonThumbnail>
|
||||
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
|
||||
</IonThumbnail>
|
||||
@ -15,8 +14,6 @@ const Example: React.SFC<{}> = () => (
|
||||
</IonThumbnail>
|
||||
<IonLabel>Item Thumbnail</IonLabel>
|
||||
</IonItem>
|
||||
</>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default Example;
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user