Skip to content

Commit d446f39

Browse files
committed
improvement(wrapped): 增加返回聊天页按钮
- Wrapped 页左上角新增返回按钮,快速回到 /chat
1 parent c6cbb93 commit d446f39

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

frontend/pages/wrapped/index.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@
1313
<!-- 左上角:刷新 + 复古模式开关 -->
1414
<div class="absolute top-6 left-6 z-20 select-none">
1515
<div class="flex items-center gap-3">
16+
<button
17+
type="button"
18+
class="pointer-events-auto inline-flex items-center justify-center w-9 h-9 rounded-full bg-transparent text-[#07C160] hover:bg-[#07C160]/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#07C160]/30 transition"
19+
aria-label="返回上一级"
20+
title="返回上一级"
21+
@click="goBack"
22+
>
23+
<svg
24+
class="w-4 h-4"
25+
viewBox="0 0 24 24"
26+
fill="none"
27+
stroke="currentColor"
28+
stroke-width="2"
29+
stroke-linecap="round"
30+
stroke-linejoin="round"
31+
aria-hidden="true"
32+
>
33+
<path d="M10 19l-7-7m0 0l7-7m-7 7h18" />
34+
</svg>
35+
</button>
36+
1637
<button
1738
type="button"
1839
class="pointer-events-auto inline-flex items-center justify-center w-9 h-9 rounded-full bg-transparent text-[#07C160] hover:bg-[#07C160]/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#07C160]/30 disabled:opacity-60 disabled:cursor-not-allowed transition"
@@ -291,6 +312,10 @@ const goTo = (i) => {
291312
activeIndex.value = clampIndex(i)
292313
}
293314
315+
const goBack = async () => {
316+
await router.push('/chat')
317+
}
318+
294319
const next = () => goTo(activeIndex.value + 1)
295320
const prev = () => goTo(activeIndex.value - 1)
296321

0 commit comments

Comments
 (0)