Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf4109c6

Browse files
committed
[Fix]:#2076 mobile nav app not passing params
1 parent013cd90 commitf4109c6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

‎client/packages/lowcoder/src/comps/comps/layout/mobileTabLayout.tsx‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import { LayoutActionComp } from "./layoutActionComp";
3434
import{defaultTheme}from"@lowcoder-ee/constants/themeConstants";
3535
import{clickEvent,eventHandlerControl}from"@lowcoder-ee/comps/controls/eventHandlerControl";
3636
import{childrenToProps}from"@lowcoder-ee/comps/generators/multi";
37+
import{useAppPathParam}from"util/hooks";
38+
import{ALL_APPLICATIONS_URL}from"constants/routesURL";
3739

3840
constTabBar=React.lazy(()=>import("antd-mobile/es/components/tab-bar"));
3941
constTabBarItem=React.lazy(()=>
@@ -389,6 +391,7 @@ let MobileTabLayoutTmp = (function () {
389391
MobileTabLayoutTmp=withViewFn(MobileTabLayoutTmp,(comp)=>{
390392
const[tabIndex,setTabIndex]=useState(0);
391393
const{ readOnly}=useContext(ExternalEditorContext);
394+
constpathParam=useAppPathParam();
392395
constnavStyle=comp.children.navStyle.getView();
393396
constnavItemStyle=comp.children.navItemStyle.getView();
394397
constnavItemHoverStyle=comp.children.navItemHoverStyle.getView();
@@ -466,7 +469,23 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
466469
:undefined,
467470
}))}
468471
selectedKey={tabIndex+""}
469-
onChange={(key)=>setTabIndex(Number(key))}
472+
onChange={(key)=>{
473+
constnextIndex=Number(key);
474+
setTabIndex(nextIndex);
475+
// push URL with query/hash params like desktop nav
476+
if(dataOptionType===DataOption.Manual){
477+
constselectedTab=tabViews[nextIndex];
478+
if(selectedTab){
479+
consturl=[
480+
ALL_APPLICATIONS_URL,
481+
pathParam.applicationId,
482+
pathParam.viewMode,
483+
nextIndex,
484+
].join("/");
485+
selectedTab.children.action.act(url);
486+
}
487+
}
488+
}}
470489
readOnly={!!readOnly}
471490
canvasBg={bgColor}
472491
tabStyle={{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp