How to get back-end Interface data by redirecting pages with vue-cli

I know that we can write the AJAX request in the corresponding trigger event function for the click event, but where should the request be written when the page jumps.

Feb.16,2022

routing guard, or just do it in the component life cycle. The navigation guard of


vue router tries


A page to jump to page B and write the request in page B methods, which can be executed in created.


vue lifecycle.

Menu