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
argument | type | acquiesce | Instructions |
---|---|---|---|
eventType | Event modifier | click | Event type, which can be null |
delay | Time, in milliseconds | 300 | Delay time, which can be empty |
handleEvent | - | - | Processing event, required |
Example: v-debounce:click-1000="handle"
eventType: click
delay: 1000
handleEvent: handle