Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

50 lines
1.3 KiB

<script>
import { cssVars, createClasses } from "./cssVars"
export let className = ""
export let onLoad
export let type = "div"
export let _bb
let containerElement
let hasLoaded
let currentChildren
$: {
if (containerElement) {
_bb.attachChildren(containerElement)
if (!hasLoaded) {
_bb.call("onLoad")
hasLoaded = true
}
}
}
</script>
{#if type === 'div'}
<div bind:this={containerElement} />
{:else if type === 'header'}
<header bind:this={containerElement} />
{:else if type === 'main'}
<main bind:this={containerElement} />
{:else if type === 'footer'}
<footer bind:this={containerElement} />
{:else if type === 'aside'}
<aside bind:this={containerElement} />
{:else if type === 'summary'}
<summary bind:this={containerElement} />
{:else if type === 'details'}
<details bind:this={containerElement} />
{:else if type === 'article'}
<article bind:this={containerElement} />
{:else if type === 'nav'}
<nav bind:this={containerElement} />
{:else if type === 'mark'}
<mark bind:this={containerElement} />
{:else if type === 'figure'}
<figure bind:this={containerElement} />
{:else if type === 'figcaption'}
<figcaption bind:this={containerElement} />
{:else if type === 'paragraph'}
<p bind:this={containerElement} />
{/if}