mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
Merge remote-tracking branch 'origin/main' into sync-6.2-with-main
This commit is contained in:
@ -26,6 +26,7 @@ import OverlayHooks from './pages/overlay-hooks/OverlayHooks';
|
||||
import OverlayComponents from './pages/overlay-components/OverlayComponents';
|
||||
import KeepContentsMounted from './pages/overlay-components/KeepContentsMounted';
|
||||
import Tabs from './pages/Tabs';
|
||||
import NavComponent from './pages/navigation/NavComponent';
|
||||
|
||||
setupIonicReact();
|
||||
|
||||
@ -37,6 +38,7 @@ const App: React.FC = () => (
|
||||
<Route path="/overlay-hooks" component={OverlayHooks} />
|
||||
<Route path="/overlay-components" component={OverlayComponents} />
|
||||
<Route path="/keep-contents-mounted" component={KeepContentsMounted} />
|
||||
<Route path="/navigation" component={NavComponent} />
|
||||
<Route path="/tabs" component={Tabs} />
|
||||
</IonRouterOutlet>
|
||||
</IonReactRouter>
|
||||
|
@ -36,6 +36,11 @@ const Main: React.FC<MainProps> = () => {
|
||||
<IonLabel>Keep Contents Mounted Overlay Components</IonLabel>
|
||||
</IonItem>
|
||||
</IonList>
|
||||
<IonList>
|
||||
<IonItem routerLink="/navigation">
|
||||
<IonLabel>Navigation</IonLabel>
|
||||
</IonItem>
|
||||
</IonList>
|
||||
<IonList>
|
||||
<IonItem routerLink="/tabs">
|
||||
<IonLabel>Tabs</IonLabel>
|
||||
|
@ -0,0 +1,84 @@
|
||||
import {
|
||||
IonButton,
|
||||
IonContent,
|
||||
IonHeader,
|
||||
IonLabel,
|
||||
IonNav,
|
||||
IonNavLink,
|
||||
IonTitle,
|
||||
IonToolbar,
|
||||
IonButtons,
|
||||
IonBackButton,
|
||||
IonPage,
|
||||
} from '@ionic/react';
|
||||
import React from 'react';
|
||||
|
||||
const NavComponent: React.FC = () => {
|
||||
return (
|
||||
<IonPage>
|
||||
<IonNav
|
||||
root={() => {
|
||||
return (
|
||||
<>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonTitle>Page One</IonTitle>
|
||||
<IonButtons>
|
||||
<IonBackButton />
|
||||
</IonButtons>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
<IonContent id="pageOneContent">
|
||||
<IonLabel>Page one content</IonLabel>
|
||||
<IonNavLink
|
||||
routerDirection="forward"
|
||||
component={() => {
|
||||
return (
|
||||
<>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonTitle>Page Two</IonTitle>
|
||||
<IonButtons>
|
||||
<IonBackButton />
|
||||
</IonButtons>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
<IonContent id="pageTwoContent">
|
||||
<IonLabel>Page two content</IonLabel>
|
||||
<IonNavLink
|
||||
routerDirection="forward"
|
||||
component={() => (
|
||||
<>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonTitle>Page Three</IonTitle>
|
||||
<IonButtons>
|
||||
<IonBackButton />
|
||||
</IonButtons>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
<IonContent>
|
||||
<IonLabel>Page three content</IonLabel>
|
||||
</IonContent>
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<IonButton>Go to Page Three</IonButton>
|
||||
</IonNavLink>
|
||||
</IonContent>
|
||||
</>
|
||||
);
|
||||
}}
|
||||
>
|
||||
<IonButton>Go to Page Two</IonButton>
|
||||
</IonNavLink>
|
||||
</IonContent>
|
||||
</>
|
||||
);
|
||||
}}
|
||||
></IonNav>
|
||||
</IonPage>
|
||||
);
|
||||
};
|
||||
|
||||
export default NavComponent;
|
@ -49,7 +49,7 @@ const ModalHook: React.FC = () => {
|
||||
setCount(count + 1);
|
||||
}, [count, setCount]);
|
||||
|
||||
const handleDismissWithComponent = useCallback((data, role) => {
|
||||
const handleDismissWithComponent = useCallback((data: any, role: string) => {
|
||||
dismissWithComponent(data, role);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
Reference in New Issue
Block a user