stacks/vite-plugin-tauri
feat: call custom window on tray icon event
#13
Open
iamzjohn
wants to merge
feat/custom_window
into
main
43 files
+5245
-1
examples/tray-with-custom-tray-menu-window/src/main.jsadded+20-0Changes to examples/tray-with-custom-tray-menu-window/src/main.js | @@ -0,0 +1,20 @@ |
| 1 | +import { createApp } from 'vue' |
| 2 | +import App from './App.vue' |
| 3 | +import { initTray } from './tray' |
| 4 | +import './style.css' |
| 5 | + |
| 6 | + |
| 7 | +const app = createApp(App) |
| 8 | +app.mount('#app') |
| 9 | + |
| 10 | + |
| 11 | +document.addEventListener('DOMContentLoaded', async () => { |
| 12 | + try { |
| 13 | + await initTray() |
| 14 | + |
| 15 | + console.log('System tray initialized') |
| 16 | + } |
| 17 | + catch (error) { |
| 18 | + console.error('Failed to initialize system tray:', error) |
| 19 | + } |
| 20 | +}) |