mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
chore(): sync vue tabs changes with master
This commit is contained in:
@ -131,6 +131,43 @@ async function presentLoadingWithOptions() {
|
||||
### React
|
||||
|
||||
```tsx
|
||||
/* Using with useIonLoading Hook */
|
||||
|
||||
import React from 'react';
|
||||
import { IonButton, IonContent, IonPage, useIonLoading } from '@ionic/react';
|
||||
|
||||
interface LoadingProps {}
|
||||
|
||||
const LoadingExample: React.FC<LoadingProps> = () => {
|
||||
const [present] = useIonLoading();
|
||||
return (
|
||||
<IonPage>
|
||||
<IonContent>
|
||||
<IonButton
|
||||
expand="block"
|
||||
onClick={() =>
|
||||
present({
|
||||
duration: 3000,
|
||||
})
|
||||
}
|
||||
>
|
||||
Show Loading
|
||||
</IonButton>
|
||||
<IonButton
|
||||
expand="block"
|
||||
onClick={() => present('Loading', 2000, 'dots')}
|
||||
>
|
||||
Show Loading using params
|
||||
</IonButton>
|
||||
</IonContent>
|
||||
</IonPage>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
```tsx
|
||||
/* Using with IonLoading Component */
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { IonLoading, IonButton, IonContent } from '@ionic/react';
|
||||
|
||||
|
||||
@ -1,4 +1,41 @@
|
||||
```tsx
|
||||
/* Using with useIonLoading Hook */
|
||||
|
||||
import React from 'react';
|
||||
import { IonButton, IonContent, IonPage, useIonLoading } from '@ionic/react';
|
||||
|
||||
interface LoadingProps {}
|
||||
|
||||
const LoadingExample: React.FC<LoadingProps> = () => {
|
||||
const [present] = useIonLoading();
|
||||
return (
|
||||
<IonPage>
|
||||
<IonContent>
|
||||
<IonButton
|
||||
expand="block"
|
||||
onClick={() =>
|
||||
present({
|
||||
duration: 3000,
|
||||
})
|
||||
}
|
||||
>
|
||||
Show Loading
|
||||
</IonButton>
|
||||
<IonButton
|
||||
expand="block"
|
||||
onClick={() => present('Loading', 2000, 'dots')}
|
||||
>
|
||||
Show Loading using params
|
||||
</IonButton>
|
||||
</IonContent>
|
||||
</IonPage>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
```tsx
|
||||
/* Using with IonLoading Component */
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { IonLoading, IonButton, IonContent } from '@ionic/react';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user