only replace components for changed segments

This commit is contained in:
Rich Harris
2018-07-17 15:42:35 -04:00
parent 84aaf3be4a
commit f126c6ac6c
7 changed files with 180 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
<span>x: {segment} {count}</span>
<svelte:component this={child.component} {...child.props}/>
<script>
import counts from './_counts.js';
export default {
preload() {
return {
count: counts.x += 1
};
},
oncreate() {
this.set({
segment: this.get().params.x
});
}
};
</script>