mirror of https://github.com/sveltejs/svelte
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.
25 lines
323 B
25 lines
323 B
8 years ago
|
<Widget foo='{{foo}}' bar='{{bar}}'/>
|
||
|
|
||
|
<script>
|
||
|
import Widget from './Widget.html';
|
||
|
|
||
|
export default {
|
||
|
data () {
|
||
|
return {
|
||
|
foo: { x: 1 },
|
||
|
bar: { x: 1 }
|
||
|
}
|
||
|
},
|
||
|
|
||
7 years ago
|
onstate({ changed, current }) {
|
||
|
if (changed.foo) {
|
||
|
this.set({ bar: current.foo });
|
||
|
}
|
||
8 years ago
|
},
|
||
|
|
||
|
components: {
|
||
|
Widget
|
||
|
}
|
||
|
};
|
||
|
</script>
|