mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
22 lines
258 B
HTML
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>
|