layout displays form action result messages

This commit is contained in:
Erin 2023-11-12 17:57:57 -05:00
parent c6cbc0646e
commit 24eb95d63c

13
src/routes/+layout.svelte Normal file
View 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/>