feat: 添加快捷键和关闭提示以及最小化功能

This commit is contained in:
alger
2023-12-20 10:23:15 +08:00
parent 7cb1b5fc7c
commit bb1b07e0b3
5 changed files with 99 additions and 31 deletions
+15 -1
View File
@@ -16,6 +16,9 @@
</template>
<script setup lang="ts">
import { useDialog } from 'naive-ui'
const dialog = useDialog()
const minimize = () => {
window.electronAPI.minimize()
@@ -26,7 +29,18 @@ const maximize = () => {
}
const close = () => {
window.electronAPI.close()
dialog.warning({
title: '提示',
content: '确定要退出吗?',
positiveText: '最小化',
negativeText: '关闭',
onPositiveClick: () => {
window.electronAPI.miniTray()
},
onNegativeClick: () => {
window.electronAPI.close()
}
})
}
const drag = (event: HTMLElement) => {