-
-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
todoThings to doThings to do
Description
Description
目前看起来useDebounceFn等 , 不支持 一个动态的wait . 参考以下代码
<template>
{{ waitTime }}
<button @click="handleClick">点击</button>
<button @click="handleSetWaitTime">设置等待时间</button>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { useDebounceFn } from "vue-hooks-plus";
const waitTime = ref(500);
const { run: fn } = useDebounceFn(
() => {
console.log("fn time", new Date().getTime());
},
{ wait: waitTime.value }
);
const handleClick = () => {
console.log("click time", new Date().getTime());
fn();
};
const handleSetWaitTime = () => {
waitTime.value = 2000;
};
</script>
Suggested solution
希望支持动态wait
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
todoThings to doThings to do