fix: 修复侧边栏拖拽区域的国际化文案和鼠标样式

- 添加 toggleSidebar 的中英文翻译
- 移除无效的拖拽鼠标样式,改为 pointer
- 使用 i18n 替换硬编码的英文文本

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 05:15:24 +08:00
parent 3716a2a80f
commit e89b212dbb
3 changed files with 9 additions and 6 deletions
@@ -2,11 +2,13 @@
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
import { useSidebar } from "./utils"
import { useI18n } from "vue-i18n"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
const { t } = useI18n()
const { toggleSidebar } = useSidebar()
</script>
@@ -14,16 +16,15 @@ const { toggleSidebar } = useSidebar()
<button
data-sidebar="rail"
data-slot="sidebar-rail"
aria-label="Toggle Sidebar"
:aria-label="t('common.toggleSidebar')"
:tabindex="-1"
title="Toggle Sidebar"
:title="t('common.toggleSidebar')"
:class="cn(
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex',
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
'cursor-pointer',
props.class,
)"
@click="toggleSidebar"
+2 -1
View File
@@ -77,7 +77,8 @@
"admin": "Admin",
"agent": "Agent",
"basicPlan": "Basic Plan",
"normal": "Normal"
"normal": "Normal",
"toggleSidebar": "Toggle Sidebar"
},
"premium": {
"premium": "premium",
+2 -1
View File
@@ -77,7 +77,8 @@
"admin": "管理员",
"agent": "代理商",
"basicPlan": "基础版",
"normal": "正常"
"normal": "正常",
"toggleSidebar": "切换侧边栏"
},
"premium": {
"premium": "会员计划",