From 7f0cc3448ec4501a122bc2c7ad15647b11c4d627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E5=B0=91=E9=A3=9E?= Date: Wed, 3 Apr 2024 13:25:08 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix(slots):=20=E4=BF=AE=E5=A4=8Dnav?= =?UTF-8?q?=E6=98=AF=E5=A4=96=E9=93=BE=E6=97=B6=E7=9A=84=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/slots/Navbar/index.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/slots/Navbar/index.tsx b/src/slots/Navbar/index.tsx index 621d658..7d2f6fc 100644 --- a/src/slots/Navbar/index.tsx +++ b/src/slots/Navbar/index.tsx @@ -1,6 +1,6 @@ import { TabsNav } from '@lobehub/ui'; import { createStyles } from 'antd-style'; -import { Link, history } from 'dumi'; +import { Link } from 'dumi'; import NavbarExtra from 'dumi/theme-default/slots/NavbarExtra'; import { memo } from 'react'; import { shallow } from 'zustand/shallow'; @@ -35,19 +35,16 @@ const Navbar = memo(() => { className={styles.tabs} items={nav.map((item) => ({ key: String(item.activePath! || item.link), - label: ( + label: /^(\w+:)\/\/|^(mailto|tel):/.test(item.link) ? ( + + {item.title} + + ) : ( {item.title} ), }))} - onChange={(path) => { - const url = nav.find((index) => index.activePath === path || index.link === path)?.link; - - if (!url) return; - - history.push(url); - }} />