mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-11 21:06:56 +08:00
添加客户端
This commit is contained in:
31
src/client/ClientTest.vue
Normal file
31
src/client/ClientTest.vue
Normal 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>
|
||||
Reference in New Issue
Block a user