We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc83c5f commit 8659253Copy full SHA for 8659253
src/routes/(v1)/url/+page.svelte
@@ -1,20 +1,16 @@
1
<script lang="ts">
2
- import type { PageData } from './$types.js';
3
import { goto } from '$app/navigation';
4
import { superForm } from '$lib/client/index.js';
5
import SuperDebug from '$lib/client/SuperDebug.svelte';
6
- import { onMount } from 'svelte';
7
8
- export let data: PageData;
+ let { data } = $props();
9
10
const { form, errors, enhance } = superForm(data.form, {
11
- taintedMessage: null
12
- });
13
-
14
- onMount(() => {
15
- form.subscribe((form) => {
16
- if (form.id) goto(`?id=${form.id}`);
17
+ taintedMessage: null,
+ onChange(e) {
+ const id = e.get('id');
+ if (id) goto('?id=' + id);
+ }
18
});
19
</script>
20
0 commit comments