layout displays form action result messages
This commit is contained in:
parent
c6cbc0646e
commit
24eb95d63c
13
src/routes/+layout.svelte
Normal file
13
src/routes/+layout.svelte
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import {page} from '$app/stores'
|
||||||
|
|
||||||
|
$: console.log('form in layout:', $page.form)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if $page.form?.message}
|
||||||
|
<p class="message" class:error={!!$page.form.error} class:success={!!$page.form.success}>
|
||||||
|
{$page.form.message}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<slot/>
|
Loading…
Reference in a new issue