1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00
budibase/packages/client/src/components/Block.svelte
2021-11-02 12:58:38 +00:00

16 lines
422 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>