How to destroy a plug-in during vue route switching

I have a plug-in that is a pop-up window

clipboard.png

when I clicked the arrow above to return to the previous page, the plug-in still existed. Could you tell me how to make him disappear?

May.22,2021

I don't know which component library toast component you are using

I think there should be a way to destroy toast in api documents

all you need to do is to destroy the toast when you click back.


plug-ins are generally global, so there is no need to destroy them. Or your requirements are just hidden, just hidden in the router.beforeEach hook.


take a look at the plug-in usage documentation.


perform the following toast destruction when the current vue component is destroyed. Of course, as mentioned on the first floor, it is also possible to destroy the destoryed, when it returns. In which life cycle do you want the toast to exist in the component's life cycle, do the corresponding processing in the hook corresponding to the life cycle


page destoryed, control the css to hide or control the explicit and hidden data to be false

Menu