@@ -110,7 +110,7 @@ const LazyIcon: FunctionalComponent<{
110110 icon : VNodeChild | string ;
111111 iconPrefixes ?: string ;
112112 prefixCls ?: string ;
113- } > = ( props ) => {
113+ } > = props => {
114114 const { icon, iconPrefixes = 'icon-' , prefixCls = 'ant-pro' } = props ;
115115 if ( ! icon ) {
116116 return null ;
@@ -193,12 +193,13 @@ class MenuUtil {
193193 ) ;
194194 }
195195
196- const menuItemRender = this . props . menuItemRender && withCtx ( this . props . menuItemRender , this . ctx )
196+ const menuItemRender =
197+ this . props . menuItemRender && withCtx ( this . props . menuItemRender , this . ctx ) ;
197198
198199 const [ title , icon ] = this . getMenuItem ( item ) ;
199200
200201 return (
201- ( menuItemRender && menuItemRender ( { item, title, icon } ) as VNode ) || (
202+ ( menuItemRender && ( menuItemRender ( { item, title, icon } ) as VNode ) ) || (
202203 < Menu . Item
203204 disabled = { item . meta ?. disabled }
204205 danger = { item . meta ?. danger }
@@ -250,41 +251,44 @@ export type MenuOnSelect = {
250251 item : VNodeChild | any ;
251252 domEvent : MouseEvent ;
252253 selectedKeys : string [ ] ;
253- }
254+ } ;
254255
255- export type MenuOnClick = {
256+ export type MenuOnClick = {
256257 item : VNodeChild ;
257258 key : string | number ;
258259 keyPath : string | string [ ] | number | number [ ] ;
259- }
260+ } ;
260261
261262export default defineComponent ( {
262263 name : 'BaseMenu' ,
263264 props : baseMenuProps ,
264265 emits : [ 'update:openKeys' , 'update:selectedKeys' , 'click' ] ,
265266 setup ( props , { emit } ) {
266- const ctx = getCurrentInstance ( )
267+ const ctx = getCurrentInstance ( ) ;
267268 const menuUtil = new MenuUtil ( props , ctx ) ;
268269 // update iconfontUrl
269270 watchEffect ( ( ) => {
270271 if ( props . iconfontUrl ) {
271272 IconFont = createFromIconfontCN ( {
272273 scriptUrl : props . iconfontUrl ,
273- } )
274+ } ) ;
274275 }
275- } )
276+ } ) ;
276277
277278 const handleOpenChange = ( openKeys : string [ ] ) : void => {
278279 emit ( 'update:openKeys' , openKeys ) ;
279280 } ;
280281 const handleSelect = ( args : MenuOnSelect ) : void => {
282+ // ignore https? link handle selectkeys
283+ if ( isUrl ( args . key as string ) ) {
284+ return ;
285+ }
281286 emit ( 'update:selectedKeys' , args . selectedKeys ) ;
282287 } ;
283288 const handleClick = ( args : MenuOnClick ) => {
284289 emit ( 'click' , args ) ;
285290 } ;
286291
287-
288292 return ( ) => {
289293 return (
290294 < Menu
@@ -301,7 +305,7 @@ export default defineComponent({
301305 >
302306 { menuUtil . getNavMenuItems ( props . menuData ) }
303307 </ Menu >
304- )
308+ ) ;
305309 } ;
306310 } ,
307311} ) ;
0 commit comments