Skip to content

v-debounce

Function Introduction

Anti-shaking function

Example

Usage

typescript
<script setup lang="ts">
  const handle = () => {
    window.alert('Triggered an event')
  }
</script>
<template>
  <button v-debounce="handle">Quick click me</button>
</template>

Rule

argumenttypeacquiesceInstructions
eventTypeEvent modifierclickEvent type, which can be null
delayTime, in milliseconds300Delay time, which can be empty
handleEvent--Processing event, required

Example: v-debounce:click-1000="handle"

eventType: click

delay: 1000

handleEvent: handle

Released under the MIT License.