Skip to content

MazPullToRefresh

MazPullToRefresh is a standalone component to add pull to refresh feature

Before use it, you should install the MazUi plugin in your project, follow instructions in Getting Started

Demo

MazPullToRefresh

Basic usage

Wrap your app inside this component

vue
<script lang="ts" setup>
import MazPullToRefresh from 'maz-ui/components/MazPullToRefresh'

async function pullToRefreshAction() {
  // do promise or just `window.location.reload()`
}
</script>

<template>
  <MazPullToRefresh
    header-class="maz-bg-bg-dark maz-text-foreground-light"
    class="maz-flex maz-min-h-screen maz-w-full maz-flex-col"
    :action="pullToRefreshAction"
    spinner-color="contrast"
    standalone-mode
    :disabled="false"
  >
    <div>
      App Content
    </div>
  </MazPullToRefresh>
</template>

WARNING

More documentation to come

Props

NameDescriptionTypeRequiredDefault
distancenumberNo100
offsetnumberNo0
on-clickTSFunctionTypeNoundefined
container-selectorstringNoundefined
header-classstringNoundefined
spinner-colorMazColorNo'contrast'
disabledbooleanNofalse
standalone-modebooleanNofalse

Events

Event namePropertiesDescription
loaded
start
error
finish
response

Slots

NameDescriptionBindings
pull-before
pull-ready
pull-loading
default