mirror of https://github.com/sveltejs/svelte
15 lines
246 B
15 lines
246 B
6 years ago
|
<script>
|
||
|
import { createEventDispatcher } from 'svelte';
|
||
|
|
||
|
const dispatch = createEventDispatcher();
|
||
|
|
||
|
function sayHello() {
|
||
|
dispatch('message', {
|
||
|
text: 'Hello!'
|
||
|
});
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<button on:click={sayHello}>
|
||
|
Click to say hello
|
||
|
</button>
|