1
0
Fork 0
mirror of synced 2024-09-19 02:39:37 +12:00
budibase/packages/standard-components/src/NewRow.svelte

33 lines
591 B
Svelte
Raw Normal View History

<script>
import { onMount } from "svelte"
import { fetchTableDefinition } from "@budibase/component-sdk"
export let _bb
export let table
let row = {}
$: {
row.tableId = table
}
let target
onMount(async () => {
if (table && typeof table === "string") {
const tableObj = await fetchTableDefinition(table)
row.tableId = table
row._table = tableObj
_bb.attachChildren(target, {
context: row,
})
} else {
_bb.attachChildren(target, {
context: {},
})
}
})
</script>
<section bind:this={target} />