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
|
```html
|
||||||
|
<!-- Default Refresher -->
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-refresher (ionRefresh)="doRefresh($event)">
|
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||||
<ion-refresher-content></ion-refresher-content>
|
<ion-refresher-content></ion-refresher-content>
|
||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
</ion-content>
|
</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
|
```typescript
|
||||||
@Component({...})
|
import { Component } from '@angular/core';
|
||||||
export class NewsFeedPage {
|
|
||||||
|
@Component({
|
||||||
|
selector: 'refresher-example',
|
||||||
|
templateUrl: 'refresher-example.html',
|
||||||
|
styleUrls: ['./refresher-example.css'],
|
||||||
|
})
|
||||||
|
export class RefresherExample {
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
doRefresh(event) {
|
doRefresh(event) {
|
||||||
console.log('Begin async operation', refresher);
|
console.log('Begin async operation');
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('Async operation has ended');
|
console.log('Async operation has ended');
|
||||||
event.target.complete();
|
event.target.complete();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
```html
|
```html
|
||||||
|
<!-- Default Refresher -->
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-refresher slot="fixed">
|
<ion-refresher slot="fixed">
|
||||||
<ion-refresher-content>
|
<ion-refresher-content></ion-refresher-content>
|
||||||
</ion-refresher-content>
|
|
||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
<!-- or for custom content -->
|
<!-- Custom Refresher Content -->
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-refresher slot="fixed">
|
<ion-refresher slot="fixed">
|
||||||
<ion-refresher-content
|
<ion-refresher-content
|
||||||
|
|||||||
Reference in New Issue
Block a user