Skip to content

Commit c0c6414

Browse files
committed
fix(router): fix for routable swipeable tabs
1 parent 7352e94 commit c0c6414

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/modules/router/router-class.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ class Router extends Framework7Class {
595595

596596
if (query) {
597597
if (typeof query === 'string') url += `?${query}`;
598-
else url += `?${serializeObject(query)}`;
598+
else if (Object.keys(query).length) url += `?${serializeObject(query)}`;
599599
}
600600

601601
return url;
@@ -611,7 +611,10 @@ class Router extends Framework7Class {
611611
flattenedRoutes.forEach((route) => {
612612
if (route.parentPath === parentPath && route.tab && route.tab.id === tabId) {
613613
if (router.currentRoute.params && Object.keys(router.currentRoute.params).length > 0) {
614-
foundTabRouteUrl = router.currentRoute.url;
614+
foundTabRouteUrl = router.constructRouteUrl(route, {
615+
params: router.currentRoute.params,
616+
query: router.currentRoute.query,
617+
});
615618
} else {
616619
foundTabRouteUrl = route.path;
617620
}

0 commit comments

Comments
 (0)