File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
client/packages/lowcoder/src/comps/comps/navComp Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
186
186
const disabled = ! ! view ?. disabled ;
187
187
const subItems = isCompItem ? view ?. items : [ ] ;
188
188
189
- const subMenuItems : Array < { key : string ; label : string } > = [ ] ;
189
+ const subMenuItems : Array < { key : string ; label : any ; disabled ?: boolean } > = [ ] ;
190
190
const subMenuSelectedKeys : Array < string > = [ ] ;
191
191
192
192
if ( Array . isArray ( subItems ) ) {
@@ -199,6 +199,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
199
199
subMenuItems . push ( {
200
200
key : key ,
201
201
label : subItem . children . label . getView ( ) ,
202
+ disabled : ! ! subItem . children . disabled . getView ( ) ,
202
203
} ) ;
203
204
} ) ;
204
205
}
@@ -230,6 +231,8 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
230
231
onClick = { ( e ) => {
231
232
if ( disabled ) return ;
232
233
const subItem = subItems [ Number ( e . key ) ] ;
234
+ const isSubDisabled = ! ! subItem ?. children ?. disabled ?. getView ?.( ) ;
235
+ if ( isSubDisabled ) return ;
233
236
const onSubEvent = subItem ?. getView ( ) ?. onEvent ;
234
237
onSubEvent && onSubEvent ( "click" ) ;
235
238
} }
You can’t perform that action at this time.
0 commit comments