mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
@ -1,6 +1,6 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Method, Prop, QueueApi, State, Watch } from '@stencil/core';
|
||||
|
||||
import { Gesture, GestureDetail, Mode } from '../../interface';
|
||||
import { Gesture, GestureDetail, Mode, RefresherEventDetail } from '../../interface';
|
||||
import { createThemedClasses } from '../../utils/theme';
|
||||
|
||||
@Component({
|
||||
@ -20,6 +20,8 @@ export class Refresher implements ComponentInterface {
|
||||
|
||||
mode!: Mode;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@Prop({ context: 'queue' }) queue!: QueueApi;
|
||||
|
||||
/**
|
||||
@ -34,8 +36,6 @@ export class Refresher implements ComponentInterface {
|
||||
*/
|
||||
@State() private state: RefresherState = RefresherState.Inactive;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
/**
|
||||
* The minimum distance the user must pull down until the
|
||||
* refresher will go into the `refreshing` state. Defaults to `60`.
|
||||
@ -77,7 +77,7 @@ export class Refresher implements ComponentInterface {
|
||||
* Updates the refresher state to `refreshing`. The `complete()` method should be
|
||||
* called when the async operation has completed.
|
||||
*/
|
||||
@Event() ionRefresh!: EventEmitter<void>;
|
||||
@Event() ionRefresh!: EventEmitter<RefresherEventDetail>;
|
||||
|
||||
/**
|
||||
* Emitted while the user is pulling down the content and exposing the refresher.
|
||||
@ -307,7 +307,9 @@ export class Refresher implements ComponentInterface {
|
||||
|
||||
// emit "refresh" because it was pulled down far enough
|
||||
// and they let go to begin refreshing
|
||||
this.ionRefresh.emit();
|
||||
this.ionRefresh.emit({
|
||||
complete: this.complete.bind(this)
|
||||
});
|
||||
}
|
||||
|
||||
private close(state: RefresherState, delay: string) {
|
||||
|
||||
Reference in New Issue
Block a user