mirror of https://github.com/sveltejs/svelte
22 lines
261 B
22 lines
261 B
8 years ago
|
<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>
|