Use block name in placeholders inside blocks
This commit is contained in:
parent
ef28b10def
commit
3fd7952a17
|
@ -67,6 +67,9 @@
|
|||
// any depth
|
||||
id: $component.id,
|
||||
|
||||
// Name can be used down the tree in placeholders
|
||||
name: $component.name,
|
||||
|
||||
// We register block components with their raw props so that we can eject
|
||||
// blocks later on
|
||||
registerComponent: registerBlockComponent,
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
|
||||
const { builderStore } = getContext("sdk")
|
||||
const component = getContext("component")
|
||||
const block = getContext("block")
|
||||
|
||||
export let text
|
||||
</script>
|
||||
|
||||
{#if $builderStore.inBuilder}
|
||||
<div>
|
||||
{text || $component.name || "Placeholder"}
|
||||
{text || block?.name || $component.name || "Placeholder"}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
|
Loading…
Reference in New Issue