Skip to content

Commit

Permalink
发布 控制按钮会把设计窗口关闭的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Dec 8, 2023
1 parent e729c03 commit dd473d8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="flex h-10 justify-end flex-0">
<button class="w-12 h-8 text-gray-500 dark:hover:text-white hover:bg-[#E9E9E9] dark:hover:bg-[#2D2D2D]"
@click="WindowMinimise()">
@click="clickWindowMinimise">
<Icon style="display: inline" icon="mdi:window-minimize"/>
</button>
<button class="w-12 h-8 text-gray-500 dark:hover:text-white hover:bg-[#E9E9E9] dark:hover:bg-[#2D2D2D]"
@click="clickMaxWindow">
<Icon style="display: inline" icon="mdi:window-maximize"/>
</button>
<button class="w-12 h-8 text-gray-500 hover:text-white hover:bg-[#C13124] dark:hover:bg-[#C13124]" @click="Quit()">
<button class="w-12 h-8 text-gray-500 hover:text-white hover:bg-[#C13124] dark:hover:bg-[#C13124]" @click="clickQuit">
<Icon style="display: inline" icon="mdi:window-close"/>
</button>
</div>
Expand All @@ -28,15 +28,34 @@ import {
WindowIsMaximised
} from "../../../../../wailsjs/runtime";
// const [isMac, setIsMac] = ref(false); // 是否是 Mac 系统
const isMaxWindow = ref(false);
let instance = getCurrentInstance();
let designMode = instance.appContext.config.globalProperties.designMode;
async function clickMaxWindow() {
if (designMode) {
return;
}
if (await WindowIsMaximised()) {
WindowUnmaximise();
} else {
WindowMaximise();
}
}
async function clickWindowMinimise() {
if (designMode) {
return;
}
WindowMinimise();
}
async function clickQuit() {
if (designMode) {
return;
}
Quit();
}
</script>
2 changes: 2 additions & 0 deletions GoEasyDesigner/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ app.provide('BoxComponentNames', BoxComponentNames)

app.config.globalProperties.t = i18n.global.t

//设置全局变量 用于判断是否为设计模式
app.config.globalProperties.designMode = true

app.use(i18n)
// app.use(TDesign)
Expand Down

0 comments on commit dd473d8

Please sign in to comment.