mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-24 08:07:23 +08:00
✨ feat: 添加快捷键和关闭提示以及最小化功能
This commit is contained in:
+24
-22
@@ -1,22 +1,24 @@
|
||||
<template>
|
||||
<div class="app">
|
||||
<n-config-provider :theme="darkTheme">
|
||||
<router-view></router-view>
|
||||
</n-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { darkTheme } from 'naive-ui'
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped >
|
||||
div {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.app {
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="app">
|
||||
<n-config-provider :theme="darkTheme">
|
||||
<n-dialog-provider>
|
||||
<router-view></router-view>
|
||||
</n-dialog-provider>
|
||||
</n-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { darkTheme } from 'naive-ui'
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped >
|
||||
div {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.app {
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user