mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(): update to Stencil One 🎉🎊
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Method, Prop, QueueApi, State, Watch } from '@stencil/core';
|
||||
|
||||
import { Gesture, GestureDetail, Mode, RefresherEventDetail } from '../../interface';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { Gesture, GestureDetail, RefresherEventDetail } from '../../interface';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-refresher',
|
||||
@ -17,8 +18,6 @@ export class Refresher implements ComponentInterface {
|
||||
private scrollEl?: HTMLElement;
|
||||
private gesture?: Gesture;
|
||||
|
||||
mode!: Mode;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@Prop({ context: 'queue' }) queue!: QueueApi;
|
||||
@ -115,7 +114,6 @@ export class Refresher implements ComponentInterface {
|
||||
|
||||
this.gesture = (await import('../../utils/gesture')).createGesture({
|
||||
el: this.el.closest('ion-content') as any,
|
||||
queue: this.queue,
|
||||
gestureName: 'refresher',
|
||||
gesturePriority: 10,
|
||||
direction: 'y',
|
||||
@ -148,7 +146,7 @@ export class Refresher implements ComponentInterface {
|
||||
* `refreshing` to `completing`.
|
||||
*/
|
||||
@Method()
|
||||
complete() {
|
||||
async complete() {
|
||||
this.close(RefresherState.Completing, '120ms');
|
||||
}
|
||||
|
||||
@ -156,7 +154,7 @@ export class Refresher implements ComponentInterface {
|
||||
* Changes the refresher's state from `refreshing` to `cancelling`.
|
||||
*/
|
||||
@Method()
|
||||
cancel() {
|
||||
async cancel() {
|
||||
this.close(RefresherState.Cancelling, '');
|
||||
}
|
||||
|
||||
@ -360,13 +358,14 @@ export class Refresher implements ComponentInterface {
|
||||
}
|
||||
|
||||
hostData() {
|
||||
const mode = getIonMode(this);
|
||||
return {
|
||||
slot: 'fixed',
|
||||
class: {
|
||||
[`${this.mode}`]: true,
|
||||
[`${mode}`]: true,
|
||||
|
||||
// Used internally for styling
|
||||
[`refresher-${this.mode}`]: true,
|
||||
[`refresher-${mode}`]: true,
|
||||
|
||||
'refresher-active': this.state !== RefresherState.Inactive,
|
||||
'refresher-pulling': this.state === RefresherState.Pulling,
|
||||
|
||||
Reference in New Issue
Block a user