chore(emit-parent): improve Svelte example clarity to match Vue examples

This commit is contained in:
Mathieu Schimmerling
2023-07-22 02:33:03 +07:00
parent b6936ef789
commit 03909e8451

View File

@@ -2,8 +2,16 @@
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
function clickYes() {
dispatch("yes");
}
function clickNo() {
dispatch("no");
}
</script>
<button on:click={() => dispatch("yes")}> YES </button>
<button on:click={clickYes}> YES </button>
<button on:click={() => dispatch("no")}> NO </button>
<button on:click={clickNo}> NO </button>