Support Svelte 3

fixes #546, #551, #552, #554
This commit is contained in:
Rich Harris
2019-02-03 14:29:47 -05:00
committed by GitHub
parent 83c8d7f855
commit ca034d0857
139 changed files with 1946 additions and 2016 deletions

View File

@@ -1,20 +1,18 @@
<span>z: {segment} {count}</span>
<a href="foo/bar/qux">click me</a>
<script>
<script context="module">
import counts from '../_counts.js';
export default {
preload() {
return {
count: counts.z += 1
};
},
export function preload() {
return {
count: counts.z += 1
};
}
</script>
oncreate() {
this.set({
segment: this.get().params.z
});
}
};
</script>
<script>
import { page } from '@sapper/app';
export let count;
</script>
<span>z: {$page.params.z} {count}</span>
<a href="foo/bar/qux">click me</a>

View File

@@ -1,22 +1,21 @@
<span>y: {segment} {count}</span>
<svelte:component this={child.component} {...child.props}/>
<span>child segment: {child.segment}</span>
<script>
<script context="module">
import counts from '../_counts.js';
export default {
preload() {
return {
count: counts.y += 1
};
},
export function preload() {
return {
count: counts.y += 1
};
}
</script>
oncreate() {
this.set({
segment: this.get().params.y
});
}
};
</script>
<script>
import { page } from '@sapper/app';
export let count;
export let child;
</script>
<span>y: {$page.params.y} {count}</span>
<svelte:component this={child.component} {...child.props}/>
<span>child segment: {child.segment}</span>