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.
 
 
 
 
 
 

47 lines
854 B

<script>
import createApp from "./createApp"
import { form } from "./props"
let _bb
let currentComponent
let _appPromise
const autoAssignIds = (props, count = 0) => {
if (!props._id) {
props._id = `auto_id_${count}`
}
if (props._children) {
for (let child of props._children) {
count += 1
autoAssignIds(child, count)
}
}
}
$: {
if (currentComponent) {
const _appPromise = createApp()
const page = {
props: form,
}
autoAssignIds(page.props)
_appPromise.then(initialise => {
initialise(page, currentComponent, "")
})
}
}
</script>
{#await _appPromise}
loading
{:then _}
<div id="current_component" bind:this={currentComponent} />
{/await}
<style>
#current_component {
height: 100%;
width: 100%;
}
</style>