Pārlūkot izejas kodu

更新 Header 组件的版本选择逻辑,改为根据 window.location.hash 判断当前路径,以支持更灵活的路由处理。

dufu1991 1 gadu atpakaļ
vecāks
revīzija
f9a5a07544
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      site/src/components/header/Header.svelte

+ 1 - 1
site/src/components/header/Header.svelte

@@ -98,7 +98,7 @@
 			</div>
 		</a>
 		<!-- 下拉选项,选择版本 -->
-		{#if window.location.pathname === '' || window.location.pathname === '/'}
+		{#if window.location.hash === '' || window.location.hash === '/' || window.location.hash === '#/'}
 			<div class="relative bottom-1">
 				<button class="flex rounded bg-black/5 py-0.5 pl-2 pr-4 text-sm dark:bg-white/20" on:click={() => (showVersion = !showVersion)}>
 					v0