useDebouncedRefHistory
Category
Export Size
1.7 kB
Last Changed
15 minutes ago
Related
具有防抖过滤器的 useRefHistory
的简写。
Demo
用法
此函数在计数器值开始变化时,会在 1000ms 后对其进行快照。
ts
import { useDebouncedRefHistory } from '@vueuse/core'
import { ref } from 'vue'
const counter = ref(0)
const { history, undo, redo } = useDebouncedRefHistory(counter, { deep: true, debounce: 1000 })
类型声明
typescript
/**
* [useRefHistory](https://vueuse.org/useRefHistory) 的防抖实现
*
* @see https://vueuse.org/useDebouncedRefHistory
* @param source
* @param options
*/
export declare function useDebouncedRefHistory<Raw, Serialized = Raw>(
source: Ref<Raw>,
options?: Omit<UseRefHistoryOptions<Raw, Serialized>, "eventFilter"> & {
debounce?: MaybeRefOrGetter<number>
},
): UseRefHistoryReturn<Raw, Serialized>
Source
贡献者
Anthony Fu
丶远方
Roman Harmyder
Anthony Fu
wheat
变更日志
v10.0.0-beta.4
on 4/13/20234d757
- feat(types)!: rename MaybeComputedRef
to MaybeRefOrGetter