mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 13:09:03 +08:00
chore(emit-parent): improve Svelte example clarity to match Vue examples
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user