You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/generator/samples/custom-method/main.html

22 lines
261 B

<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>