Vue router permissions control the problem that different components are loaded and need to be forced to refresh.

{path: "/serviceManager", component: Cookies.get("ROLES")==="admin"?admin:user}

how to solve this problem when logging out of an account with one permission and logging in to an account with another permission, and if the page is not forced to refresh, the loaded routing page is still the same?

Mar.16,2021

you certainly can't do this. This kind of route has already decided whether to load admin or user, rather than a dynamic route. You should write component as a function, which is dynamic loading.

Menu