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