diff --git a/src/renderer/src/components/NavBar.vue b/src/renderer/src/components/NavBar.vue
index 57a8b20..7a8c246 100644
--- a/src/renderer/src/components/NavBar.vue
+++ b/src/renderer/src/components/NavBar.vue
@@ -27,10 +27,10 @@
hover:bg-gray-2
hover:cursor-pointer
text="hover:hover"
- @click="back"
title="返回上一页"
+ @click="back"
>
- ⬅
+ 🏠
关于
@@ -50,6 +50,8 @@ onBeforeMount(async () => {
isFullScreen.value = await api.call("BasicCommand.isFullscreen")
})
+const { PlatForm } = usePlatForm()
+
const isHome = computed(() => {
if (route?.meta?.home) {
return true
@@ -58,7 +60,7 @@ const isHome = computed(() => {
})
function back() {
- router.back()
+ router.push("/")
}
const onClickMenu = e => {
@@ -66,30 +68,16 @@ const onClickMenu = e => {
{
label: isFullScreen.value ? "取消全屏" : "全屏",
async click() {
- isFullScreen.value = await api.call("BasicCommand.fullscreen")
+ await PlatForm.toggleFullScreen()
+ isFullScreen.value = !isFullScreen.value
},
},
{
label: "切换开发者工具",
async click() {
- isFullScreen.value = await api.call("BasicCommand.toggleDevTools")
+ PlatForm.toggleDevTools()
},
},
- // {
- // type: "separator",
- // },
- // {
- // label: "重载",
- // click() {
- // api.call("BasicCommand.reload")
- // },
- // },
- // {
- // label: "重启",
- // click() {
- // api.call("BasicCommand.relunch")
- // },
- // },
])
const obj = e.target.getBoundingClientRect()
menu.show({ x: ~~obj.x, y: ~~(obj.y + obj.height) })
diff --git a/src/renderer/src/composables/usePlatform.ts b/src/renderer/src/composables/usePlatform.ts
index 592f410..b6268e0 100644
--- a/src/renderer/src/composables/usePlatform.ts
+++ b/src/renderer/src/composables/usePlatform.ts
@@ -1,7 +1,9 @@
+import { PlatForm } from "@/platform/PlatForm"
import { Tabs } from "@/platform/Tabs"
export function usePlatForm() {
return {
Tabs: Tabs.getInstance(),
+ PlatForm: PlatForm.getInstance(),
}
}
diff --git a/src/renderer/src/platform/PlatForm.ts b/src/renderer/src/platform/PlatForm.ts
index 4d8c332..1c7e8c0 100644
--- a/src/renderer/src/platform/PlatForm.ts
+++ b/src/renderer/src/platform/PlatForm.ts
@@ -4,6 +4,14 @@ class PlatForm extends _Base {
constructor() {
super()
}
+
+ toggleFullScreen() {
+ return api.call("BasicCommand.fullscreen")
+ }
+
+ toggleDevTools() {
+ return api.call("BasicCommand.toggleDevTools")
+ }
}
export { PlatForm }