mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore(deps): update to tauri beta.9 (#1037)
This commit is contained in:
committed by
GitHub
parent
16fc0f2ee3
commit
cacf544d51
@@ -1,15 +1,15 @@
|
||||
<script>
|
||||
import { getCurrent } from "@tauri-apps/api/window";
|
||||
import { getCurrent } from "@tauri-apps/api/webview";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
const webview = getCurrent();
|
||||
|
||||
export let onMessage;
|
||||
let unlisten;
|
||||
|
||||
onMount(async () => {
|
||||
unlisten = await appWindow.listen("rust-event", onMessage);
|
||||
unlisten = await webview.listen("rust-event", onMessage);
|
||||
});
|
||||
onDestroy(() => {
|
||||
if (unlisten) {
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
function emitEvent() {
|
||||
appWindow.emit("js-event", "this is the payload string");
|
||||
webview.emit("js-event", "this is the payload string");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user