1
0
Fork 0
mirror of synced 2024-09-28 07:11:40 +12:00
budibase/packages/client/src/components/Block.svelte

16 lines
422 B
Svelte
Raw Normal View History

<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
2021-11-03 01:58:38 +13:00
setContext("block", { id: $component.id })
</script>
<div use:styleable={$component.styles}>
<slot />
</div>