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) => {
186186 const disabled = ! ! view ?. disabled ;
187187 const subItems = isCompItem ? view ?. items : [ ] ;
188188
189- const subMenuItems : Array < { key : string ; label : string } > = [ ] ;
189+ const subMenuItems : Array < { key : string ; label : any ; disabled ?: boolean } > = [ ] ;
190190 const subMenuSelectedKeys : Array < string > = [ ] ;
191191
192192 if ( Array . isArray ( subItems ) ) {
@@ -199,6 +199,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
199199 subMenuItems . push ( {
200200 key : key ,
201201 label : subItem . children . label . getView ( ) ,
202+ disabled : ! ! subItem . children . disabled . getView ( ) ,
202203 } ) ;
203204 } ) ;
204205 }
@@ -230,6 +231,8 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
230231 onClick = { ( e ) => {
231232 if ( disabled ) return ;
232233 const subItem = subItems [ Number ( e . key ) ] ;
234+ const isSubDisabled = ! ! subItem ?. children ?. disabled ?. getView ?.( ) ;
235+ if ( isSubDisabled ) return ;
233236 const onSubEvent = subItem ?. getView ( ) ?. onEvent ;
234237 onSubEvent && onSubEvent ( "click" ) ;
235238 } }
You can’t perform that action at this time.
0 commit comments