mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
@ -1,9 +1,11 @@
|
||||
import { SpinnerTypes } from '../../interface';
|
||||
|
||||
export interface LoadingOptions {
|
||||
spinner?: string;
|
||||
content?: string;
|
||||
spinner?: SpinnerTypes;
|
||||
message?: string;
|
||||
cssClass?: string | string[];
|
||||
showBackdrop?: boolean;
|
||||
duration?: number;
|
||||
translucent?: boolean;
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ export class Loading implements OverlayInterface {
|
||||
/**
|
||||
* Optional text content to display in the loading indicator.
|
||||
*/
|
||||
@Prop() content?: string;
|
||||
@Prop() message?: string;
|
||||
|
||||
/**
|
||||
* Additional classes to apply for custom CSS. If multiple classes are
|
||||
@ -83,7 +83,7 @@ export class Loading implements OverlayInterface {
|
||||
/**
|
||||
* If true, the loading indicator will animate. Defaults to `true`.
|
||||
*/
|
||||
@Prop() willAnimate = true;
|
||||
@Prop() animated = true;
|
||||
|
||||
/**
|
||||
* Emitted after the loading has unloaded.
|
||||
@ -205,7 +205,7 @@ export class Loading implements OverlayInterface {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{this.content && <div class="loading-content">{this.content}</div>}
|
||||
{this.message && <div class="loading-content">{this.message}</div>}
|
||||
</div>
|
||||
];
|
||||
}
|
||||
|
||||
@ -20,18 +20,18 @@ The loading indicator can be dismissed automatically after a specific amount of
|
||||
|
||||
| Property | Attribute | Description | Type |
|
||||
| ----------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
||||
| `animated` | `animated` | If true, the loading indicator will animate. Defaults to `true`. | `boolean` |
|
||||
| `backdropDismiss` | `backdrop-dismiss` | If true, the loading indicator will be dismissed when the backdrop is clicked. Defaults to `false`. | `boolean` |
|
||||
| `content` | `content` | Optional text content to display in the loading indicator. | `string` |
|
||||
| `cssClass` | `css-class` | Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces. | `string`, `string[]` |
|
||||
| `duration` | `duration` | Number of milliseconds to wait before dismissing the loading indicator. | `number` |
|
||||
| `enterAnimation` | -- | Animation to use when the loading indicator is presented. | `AnimationBuilder` |
|
||||
| `keyboardClose` | `keyboard-close` | If true, the loading will blur any inputs and hide the keyboard | `boolean` |
|
||||
| `leaveAnimation` | -- | Animation to use when the loading indicator is dismissed. | `AnimationBuilder` |
|
||||
| `message` | `message` | Optional text content to display in the loading indicator. | `string` |
|
||||
| `overlayId` | `overlay-id` | | `number` |
|
||||
| `showBackdrop` | `show-backdrop` | If true, a backdrop will be displayed behind the loading indicator. Defaults to `true`. | `boolean` |
|
||||
| `spinner` | `spinner` | The name of the spinner to display. Possible values are: `"lines"`, `"lines-small"`, `"dots"`, `"bubbles"`, `"circles"`, `"crescent"`. | `string` |
|
||||
| `translucent` | `translucent` | If true, the loading indicator will be translucent. Defaults to `false`. | `boolean` |
|
||||
| `willAnimate` | `will-animate` | If true, the loading indicator will animate. Defaults to `true`. | `boolean` |
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
await loadingController.componentOnReady();
|
||||
const loadingElement = await loadingController.create({
|
||||
content: 'Hellooo',
|
||||
message: 'Hellooo',
|
||||
duration: 2000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
await loadingController.componentOnReady();
|
||||
const loadingElement = await loadingController.create({
|
||||
content: 'Hellooo',
|
||||
message: 'Hellooo',
|
||||
duration: 2000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
await loadingController.componentOnReady();
|
||||
const loadingElement = await loadingController.create({
|
||||
content: 'Hellooo',
|
||||
message: 'Hellooo',
|
||||
duration: 2000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
|
||||
@ -12,7 +12,7 @@ export class LoadingExample {
|
||||
|
||||
async presentLoading() {
|
||||
const loading = await this.loadingController.create({
|
||||
content: 'Hellooo',
|
||||
message: 'Hellooo',
|
||||
duration: 2000
|
||||
});
|
||||
return await loading.present();
|
||||
@ -22,7 +22,7 @@ export class LoadingExample {
|
||||
const loading = await this.loadingController.create({
|
||||
spinner: 'hide',
|
||||
duration: 5000,
|
||||
content: 'Please wait...',
|
||||
message: 'Please wait...',
|
||||
translucent: true,
|
||||
cssClass: 'custom-class custom-loading'
|
||||
});
|
||||
|
||||
@ -4,7 +4,7 @@ async function presentLoading() {
|
||||
await loadingController.componentOnReady();
|
||||
|
||||
const loading = await loadingController.create({
|
||||
content: 'Hellooo',
|
||||
message: 'Hellooo',
|
||||
duration: 2000
|
||||
});
|
||||
return await loading.present();
|
||||
@ -17,7 +17,7 @@ async function presentLoadingWithOptions() {
|
||||
const loading = await loadingController.create({
|
||||
spinner: 'hide',
|
||||
duration: 5000,
|
||||
content: 'Please wait...',
|
||||
message: 'Please wait...',
|
||||
translucent: true,
|
||||
cssClass: 'custom-class custom-loading'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user