Skip to content

Commit

Permalink
fix: 使用搜索后有//#刷新页面页面空白的问题 DevCloudFE#1619
Browse files Browse the repository at this point in the history
  • Loading branch information
Whbbit1999 committed Feb 24, 2024
1 parent 34b0ecd commit e5f89c4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ function initialize(userOptions: DefaultTheme.AlgoliaSearchOptions) {
navigator: {
navigate({ itemUrl }) {
const _itemUrl = itemUrl.replaceAll('//', '/');
const { pathname: hitPathname } = new URL(window.location.origin + _itemUrl);
const { pathname: hitPathname } = new URL(
window.location.origin + _itemUrl,
);
// router doesn't handle same-page navigation so we use the native
// browser location API for anchor navigation
if (route.path === hitPathname) {
Expand Down

0 comments on commit e5f89c4

Please sign in to comment.