ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.09k stars 13.51k forks source link

bug: angular/react/vue, cannot set query param on tab buttons #25470

Open gooddaddy opened 2 years ago

gooddaddy commented 2 years ago

Prerequisites

Ionic Framework Version

Current Behavior

<IonTabButton
              key={item.tab}
              tab={item.tab}
              href='/a?search=1'
              className={styles.tabButton}
            >
              <NavIcon selected={!!selected} icon={item} />
              <IonLabel>{item.label}</IonLabel>
            </IonTabButton>

'search will not be in location's href

Expected Behavior

'search' will be in location's href

Steps to Reproduce

<IonTabs>
      <IonRouterOutlet id="tabs">   
       <Route  exact={exact} path='/a' render={() => <UComponent />} />
     </IonRouterOutlet>
        <IonTabButton
              key={item.tab}
              tab={item.tab}
              href='/a?search=1'
              className={styles.tabButton}
            >
              <NavIcon selected={!!selected} icon={item} />
              <IonLabel>{item.label}</IonLabel>
    </IonTabButton>
   </IonTabBar>
</IonTabs>

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.19.1

Utility:

cordova-res : not installed globally native-run : not installed globally

System:

NodeJS : v16.14.2 npm : 8.5.0 OS : macOS Big Sur

Additional Information

企业微信截图_638f61fc-855c-44eb-85bb-781e00e76479

liamdebeasi commented 2 years ago

Thanks for the issue. Can you please provide your use case for setting query params on the initial tab page? At the moment we only support query params on inner tabs pages, not on the root tabs page when clicking IonTabButton.

gooddaddy commented 2 years ago

Thanks for the issue. Can you please provide your use case for setting query params on the initial tab page? At the moment we only support query params on inner tabs pages, not on the root tabs page when clicking IonTabButton.

My web app needs to implement a dynamic page, the navigation bar is dynamically configured on the web side, tabbutton needs to jump to the specified page that requires more query parameters.

holvold commented 3 weeks ago

What is the status on this? I'm working with these version of ionic in react, and the problem still exists. "@ionic/core": "7.6.3", "@ionic/react": "7.6.3", "@ionic/react-router": "7.6.3",