mirror of https://github.com/sveltejs/svelte
20 lines
272 B
20 lines
272 B
8 years ago
|
<p>bar in Foo: {{bar}}</p>
|
||
|
<p>baz in Foo: {{baz}}</p>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
bar: 1,
|
||
|
baz: 2
|
||
|
};
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
double() {
|
||
|
const { bar, baz } = this.get();
|
||
|
this.set({ bar: bar * 2, baz: baz * 2 });
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
</script>
|