The correct solution to the refresh failure after vue addRoutes dynamically adds a road

There are a lot of solutions to this problem on the Internet, probably saying that the browser localStorage is used to achieve it. In my opinion, this is superfluous . It is caused by the incorrect use of routing.

The correct solution is to use Promise. The following code:

1. Add routes asynchronously

2. After successful login

This solves the above problem

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324074081&siteId=291194637