1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +12:00
budibase/packages/client/src/components/Block.svelte

18 lines
429 B
Svelte

<script>
import { getContext, setContext } from "svelte"
const component = getContext("component")
const { styleable } = getContext("sdk")
// We need to set a block context to know we're inside a block, but also
// to be able to reference the actual component ID of the block from
// any depth
setContext("block", {
id: $component.id,
})
</script>
<div use:styleable={$component.styles}>
<slot />
</div>