fix(core): update
This commit is contained in:
parent
806e121144
commit
f7e5af4113
@ -80,11 +80,11 @@ export class SmartRouter {
|
|||||||
*/
|
*/
|
||||||
async _handleRouteState() {
|
async _handleRouteState() {
|
||||||
const currentLocation = window.location.pathname;
|
const currentLocation = window.location.pathname;
|
||||||
const wantedRoute = this.routes.find((routeArg) => {
|
const wantedRoutes = this.routes.filter((routeArg) => {
|
||||||
return !!routeArg.matchFunction(currentLocation);
|
return !!routeArg.matchFunction(currentLocation);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (wantedRoute) {
|
for (const wantedRoute of wantedRoutes) {
|
||||||
const routeResult = wantedRoute.matchFunction(currentLocation);
|
const routeResult = wantedRoute.matchFunction(currentLocation);
|
||||||
await wantedRoute.handler(routeResult.valueOf() as IRouteInfo);
|
await wantedRoute.handler(routeResult.valueOf() as IRouteInfo);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user