make button children snippet
This commit is contained in:
parent
2624df7cc9
commit
3c34cb0e11
2 changed files with 6 additions and 5 deletions
|
|
@ -1,12 +1,13 @@
|
|||
<script lang="ts">
|
||||
import type { DaisyColor, DaisySize } from '$lib/types';
|
||||
import type { Snippet } from 'svelte';
|
||||
import type { HTMLButtonAttributes } from 'svelte/elements';
|
||||
|
||||
interface Props {
|
||||
block?: boolean;
|
||||
children: Snippet;
|
||||
color?: DaisyColor;
|
||||
glass?: boolean;
|
||||
label: string;
|
||||
outline?: boolean;
|
||||
onClick?: () => void;
|
||||
responsive?: boolean;
|
||||
|
|
@ -17,9 +18,9 @@
|
|||
|
||||
let {
|
||||
block = false,
|
||||
children,
|
||||
color,
|
||||
glass = false,
|
||||
label,
|
||||
outline = false,
|
||||
onClick,
|
||||
responsive = false,
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
class:btn-error={color === 'error'}
|
||||
class={`btn ${responsive && 'btn-xs sm:btn-sm md:btn-md lg:btn-lg'}`}
|
||||
>
|
||||
{label}
|
||||
{@render children()}
|
||||
</button>
|
||||
|
||||
<style></style>
|
||||
<style></style>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
{/if}
|
||||
</div>
|
||||
<div class="card-actions px-4">
|
||||
<Button block type="submit" label={messages.login_button_submit()} outline />
|
||||
<Button block type="submit" outline>{messages.login_button_submit()}</Button>
|
||||
</div>
|
||||
</form>
|
||||
{/snippet}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue