1.2.7 • Published 10 months ago

@amirafa/vue3-pull-to-refresh v1.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Vue 3 Pull-to-Refresh

A Vue 3 package that enables a pull-to-refresh experience for touch screens.

Installation

To install the package, use the following command:

npm i @amirafa/vue3-pull-to-refresh

Usage

Props

PropTypeDefaultDescription
distanceNumber50Specifies the height of pulling.
durationNumber2000Delay (in milliseconds) since the refresh action.
sizeNumber32Size of the icon (in pixels).
coefficientNumber2.5Power of reaching the distance.
noreloadBooleanfalseReload window on refresh.
optionsObject{}Customization options for icon color and background color.

Options Object Properties

PropertyTypeDefaultDescription
colorString#000The color of the icon.
bgColorString#fffThe background color of the icon or element.

Emit

EmitDescription
onrefreshEmit after refreshing

Slot

SlotDescription
defaultCustomized Element for icon

Example Usage

Here's an example of how to use the vue3-pull-to-refresh component in your Vue 3 project:

<template>
  <Vue3PullToRefresh 
    :distance="50" 
    :duration="2000" 
    :size="32" 
    noreload
    :options="{ color: '#111', bgColor: '#fff' }"
    @onrefresh="()=>{console.log('refreshed')}"
  />
</template>

<script setup lang="ts">
//@ts-ignore
import Vue3PullToRefresh from '@amirafa/vue3-pull-to-refresh';
//import '@amirafa/vue3-pull-to-refresh/dist/style.css'; deprecated
</script>

Note on @ts-ignore

To prevent TypeScript type-checking errors when importing third-party libraries that may lack complete type definitions, you can use // @ts-ignore above the import statement. This directive tells the TypeScript compiler to ignore the next line, avoiding potential type-related warnings or errors.

Preventing Interference with Chrome Mobile Refresh

To prevent conflicts with the native refresh mechanism on Chrome Mobile, add the following CSS to the body:

body {
  overscroll-behavior: none;
}

Changelog

Version 1.2.7 - 2024-11-06

Updated

  • Remove requirement to import style.css

Version 1.2.2 - 2024-11-06

Added

  • Github packages config

Version 1.2.1 - 2024-11-06

Updated

  • add ChangeLog to README

Version 1.2.1 - 2024-11-06

Fixed

  • bug on interference with touch clicks

1.2.7

10 months ago

1.2.6

10 months ago

1.2.5

10 months ago

1.2.4

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

3.0.6

11 months ago

3.0.5

11 months ago

3.0.4

11 months ago

3.0.3

11 months ago

3.0.2

11 months ago

3.0.1

11 months ago

3.0.0

11 months ago