keep-alive, was introduced to save the number of pages in Pagination, which was added on the outermost part of App.vue, but the refresh of the subcomponents encountered a problem.
The path of the sub-component is / subject/:id. I hope that each time the incoming id is captured in the sub-component, the new data will be obtained (the data acquisition is put in the mounted), but it will not be refreshed every time the keep-alive, is used.
then I thought of using watch:$route.params.id, but in this way watch will be activated twice when entering the subcomponent and leaving (id has changed twice). How can he capture changes in id only when he comes in?
if you have a problem with your thinking, please help to point it out. Thank you
.