添加客户端

This commit is contained in:
2025-04-06 13:50:16 +08:00
parent 4476be60b5
commit d5c9e663da
32 changed files with 4462 additions and 443 deletions

31
src/client/ClientTest.vue Normal file
View File

@@ -0,0 +1,31 @@
<script setup lang="ts">
import { isPermissionGranted, onAction, sendNotification } from '@tauri-apps/plugin-notification';
async function testNotification() {
let permissionGranted = await isPermissionGranted();
if (permissionGranted) {
sendNotification({
title: "测试通知",
body: "这是一个测试通知",
silent: false,
extra: { type: 'test' },
});
onAction((event) => {
console.log('Notification clicked:', event);
});
}
}
</script>
<template>
<div>
<NFlex>
<NButton
type="primary"
@click="testNotification"
>
测试通知
</NButton>
</NFlex>
</div>
</template>