mirror of https://github.com/sveltejs/svelte
25 lines
310 B
25 lines
310 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 }
|
||
|
}
|
||
|
},
|
||
|
|
||
8 years ago
|
oncreate () {
|
||
8 years ago
|
this.observe( 'foo', foo => {
|
||
|
this.set({ bar: foo });
|
||
|
});
|
||
|
},
|
||
|
|
||
|
components: {
|
||
|
Widget
|
||
|
}
|
||
|
};
|
||
|
</script>
|