mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
docs(refresher): update usage example content
This commit is contained in:
@ -1,23 +1,42 @@
|
||||
```html
|
||||
<!-- Default Refresher -->
|
||||
<ion-content>
|
||||
<ion-refresher (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher-content></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
</ion-content>
|
||||
|
||||
<!-- Custom Refresher Content -->
|
||||
<ion-content>
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher-content
|
||||
pullingIcon="arrow-dropdown"
|
||||
pullingText="Pull to refresh"
|
||||
refreshingSpinner="circles"
|
||||
refreshingText="Refreshing...">
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
</ion-content>
|
||||
```
|
||||
|
||||
```typescript
|
||||
@Component({...})
|
||||
export class NewsFeedPage {
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'refresher-example',
|
||||
templateUrl: 'refresher-example.html',
|
||||
styleUrls: ['./refresher-example.css'],
|
||||
})
|
||||
export class RefresherExample {
|
||||
constructor() {}
|
||||
|
||||
doRefresh(event) {
|
||||
console.log('Begin async operation', refresher);
|
||||
console.log('Begin async operation');
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Async operation has ended');
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
```html
|
||||
<!-- Default Refresher -->
|
||||
<ion-content>
|
||||
<ion-refresher slot="fixed">
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
<ion-refresher-content></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
</ion-content>
|
||||
|
||||
<!-- or for custom content -->
|
||||
|
||||
<!-- Custom Refresher Content -->
|
||||
<ion-content>
|
||||
<ion-refresher slot="fixed">
|
||||
<ion-refresher-content
|
||||
|
||||
Reference in New Issue
Block a user