1
0
Fork 0
mirror of synced 2024-09-15 08:47:37 +12:00
budibase/packages/standard-components/src/NewRow.svelte
2020-11-12 12:24:45 +00:00

32 lines
587 B
Svelte

<script>
import { onMount } from "svelte"
import { fetchTableDefinition } from "../../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} />