The methods in the vue component is strange because it does not seem to recalculate in multiple instantiations

1.

generated by the anti-shake function is a method for using methods in component A _

clipboard.png

Anti-shake function

export const debounce=function(delay,fn){
  console.log("debounce")
  var timer;
  return function(){
    var argu=this.arguments;
    clearTimeout(timer);
    timer=setTimeout(()=>{
      fn.apply(this,argu)
    },delay)
  }
}

there is no great god in depth, please explain, I am not very grateful!

Nov.19,2021

your function saves the last instance, no matter how many times it is called, it is the first time

if(ctx===undefined){
      ctx=this
    }
Menu