yuyou_x
2024-02-27 9c55f49b5ef7451008ae7f2734f2a9e6d604c7b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export function debounce(fn) {
    let waiting;
    return function() {
        if (waiting) return;
        waiting = true;
        const context = this,
            args = arguments;
        const later = function() {
            waiting = false;
            fn.apply(context, args);
        };
        this.$nextTick(later);
    };
}