0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/test/runtime/samples/custom-method/main.html
2018-04-15 19:08:49 -04:00

22 lines
258 B
HTML

<button on:click='add1()'>+1</button>
<p>{{counter}}</p>
<script>
export default {
data: () => ({
counter: 0
}),
methods: {
add1 () {
this.set({ counter: this.get().counter + 1 });
},
foo () {
return 42;
}
}
};
</script>