fix(vue): switching between tabs preserves query string (#24297)

resolves #23699
This commit is contained in:
Liam DeBeasi
2021-12-02 10:04:26 -05:00
committed by GitHub
parent 4b26feaa47
commit 047d3c7772
3 changed files with 27 additions and 1 deletions

View File

@ -113,9 +113,10 @@ export const IonTabBar = defineComponent({
* land on /tabs/tab1/child instead of /tabs/tab1.
*/
if (activeTab !== prevActiveTab || (prevHref !== currentRoute.pathname)) {
const search = (currentRoute.search !== undefined) ? `?${currentRoute.search}` : '';
tabs[activeTab] = {
...tabs[activeTab],
currentHref: currentRoute.pathname + (currentRoute.search || '')
currentHref: currentRoute.pathname + search
}
}