The problem of window.onresize covering each other in vue

I have used window.onresize in the hook functions of both components and found that the later components will overwrite the window.onresize of the previous components. Is there any way to ensure that the window.onresize of all components can not affect each other?


addEventListener () learn about

Menu