kosl90 / spin-delay-vue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spin-delay-vue

port from spin-delay

DO NOT test in SSR

Installation

With npm

npm install --save spin-delay-vue

With yarn

yarn add spin-delay-vue

With pnpm

pnpm add spin-delay-vue

Example

<template>
  <Spinner v-if="isLoading" />
  <template v-else>
    ...
  </template>
</template>

<script lang="ts">
import { useSpinDelay } from 'spin-delay-vue'

const { fetching } = useFetch('http://example.com');
const isLoading = useSpinDelay(fetching, { delayInMs: 500, minDurationInMs: 200 });
</script>

About

License:MIT License


Languages

Language:TypeScript 100.0%