1
0
Fork 0
mirror of synced 2024-09-09 22:16:26 +12:00
budibase/packages/standard-components/src/Heading.svelte
Michael Shanks b7d9e05641
Work on Components API & bugfixes (#102)
* typo - screens not being sent to page save

* removed children arg from hydrateChildren (n/a)

* initialiseChildren does not rerender unless forced

* removed derivatives of initialiseChildren

* renamed initialiseChildren > attachChildren

* standard-components - refactoring

div now container
H1, h2... etc now Heading with type
Select now takes option as _children

* loads of bug fixing

* safe props creation
anytime props are loaded,
we make sure they conform to the components props definition
2020-02-14 11:51:45 +00:00

24 lines
664 B
Svelte

<script>
export let className = ""
export let type
export let _bb
let containerElement
$: containerElement && _bb.attachChildren(containerElement)
</script>
{#if type === "h1"}
<h1 class={className} bind:this={containerElement}></h1>
{:else if type === "h2"}
<h2 class={className} bind:this={containerElement}></h2>
{:else if type === "h3"}
<h3 class={className} bind:this={containerElement}></h3>
{:else if type === "h4"}
<h4 class={className} bind:this={containerElement}></h4>
{:else if type === "h5"}
<h5 class={className} bind:this={containerElement}></h5>
{:else if type === "h6"}
<h6 class={className} bind:this={containerElement}></h6>
{/if}