Custom element slot for sub elements #125
Answered
by
adamberecz
matthiasPOE
asked this question in
Questions
-
<script lang="ts">
import { defineElement, ElementLayout, ButtonElement } from '@vueform/vueform';
export default defineElement({
name: 'TestElement',
setup() {
return {
clicked: () => {
window.dispatchEvent(new CustomEvent('clicked', {}))
}
}
}
})
</script>
<template>
<ElementLayout>
<template #element>
<div style="display: flex; justify-content: space-around;">
<ButtonElement name="button1">
Test
</ButtonElement>
<ButtonElement name="button2" secondary @click="() => clicked()">
TEst 2
</ButtonElement>
</div>
<div v-if="someCondition">
<!-- Show dragged elements from builder -->
</div>
</template>
<template v-for="(component, slot) in elementSlots" #[slot]>
<slot :name="slot" :el$="el$">
<component :is="component" :el$="el$" />
</slot>
</template>
</ElementLayout>
</template> Is it possible to allow more builder components to be droppable inside the |
Beta Was this translation helpful? Give feedback.
Answered by
adamberecz
May 19, 2025
Replies: 1 comment 5 replies
-
Currently the best way to achieve this is by using alternative views. I've explained and created a PoC not so long ago in another discussion, check that out: #109 (reply in thread) If you need any help after that let me know! |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
matthiasPOE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the best way to achieve this is by using alternative views. I've explained and created a PoC not so long ago in another discussion, check that out: #109 (reply in thread)
If you need any help after that let me know!