mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 12:24:47 +00:00
update some tests
This commit is contained in:
@@ -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>
|
||||
export let params;
|
||||
export let count;
|
||||
export let segment = params.z;
|
||||
</script>
|
||||
|
||||
<span>z: {segment} {count}</span>
|
||||
<a href="foo/bar/qux">click me</a>
|
||||
@@ -1,22 +1,21 @@
|
||||
<script context="module">
|
||||
import counts from '../_counts.js';
|
||||
|
||||
export function preload() {
|
||||
return {
|
||||
count: counts.y += 1
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let params;
|
||||
export let count;
|
||||
export let child;
|
||||
export let segment = params.y;
|
||||
</script>
|
||||
|
||||
<span>y: {segment} {count}</span>
|
||||
<svelte:component this={child.component} {...child.props}/>
|
||||
|
||||
<span>child segment: {child.segment}</span>
|
||||
|
||||
<script>
|
||||
import counts from '../_counts.js';
|
||||
|
||||
export default {
|
||||
preload() {
|
||||
return {
|
||||
count: counts.y += 1
|
||||
};
|
||||
},
|
||||
|
||||
oncreate() {
|
||||
this.set({
|
||||
segment: this.get().params.y
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<span>child segment: {child.segment}</span>
|
||||
Reference in New Issue
Block a user