Created
September 12, 2023 06:03
-
-
Save YonatanKra/e244489c4a43a8bc54742f18e8637db1 to your computer and use it in GitHub Desktop.
Tauri-demo: Greet logic inside a web component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.shadowRoot?.querySelector('#greet-form')?.addEventListener('submit', async (e) => { | |
e.preventDefault(); | |
const greetInputEl = this.shadowRoot?.querySelector('#greet-input') as HTMLInputElement; | |
const greetMsgEl = this.shadowRoot?.querySelector('#greet-msg') as HTMLElement; | |
greetMsgEl.textContent = await invoke('greet', { | |
name: greetInputEl.value, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment