Skip to content
On this page

v-debounce

js
<template>
  <!-- 支持文本框 按钮等 -->
  <el-button v-debounce="change">防抖</el-button>
  <el-input v-debounce="change" v-model="str"></el-input>
</template>

<script setup>
  import { ElMessage } from 'element-plus'
  const str = ref('213')
  const change = () => {
    ElMessage.success('触发了')
  }

</script>

Released under the MIT License.