+
+
+
+
-
-
-
- header
-
+
+
+
+
+
+ Default slot content.
+
+
+
+ {{ slot.content }}
+
@@ -41,16 +51,25 @@ import { onMounted, ref } from 'vue';
import NestedFunction from './NestedFunction.vue';
import DynamicComponent from './DynamicComponent.vue';
-import { useDraggable } from 'vue-draggable-plus'
+import { useDraggable } from 'vue-draggable-plus';
import { uuid } from 'lsp-uuid';
import { IComponent } from '../type/IComponent.ts';
import { componentScheme } from '../schemes/scheme.ts';
import TestComponent from './TestComponent.vue';
+
+const dynamicSlotContents = ref([
+ { slotName: 'header', content: 'Header content' },
+ { slotName: 'footer', content: 'Footer content' },
+ { slotName: 'main', content: 'Main content' }
+]);
+
+
const componentsList = ref
([]);
-const list = ref([])
-const el2 = ref()
+const list = ref([]);
+
+const el2 = ref();
onMounted(() => {
@@ -69,7 +88,7 @@ useDraggable(el2, componentsList, {
onClone() {
console.log('clone')
},
- clone(element: Record<'id' | 'name' | 'type' | 'children' | 'props' | 'text' | 'class' | 'style', any>) {
+ clone(element: Record<'id' | 'name' | 'type' | 'children' | 'props' | 'text' | 'class' | 'style'|'slots', any>) {
return {
id: `${element.id}-${uuid()}`,
name: element.name,
@@ -81,7 +100,7 @@ useDraggable(el2, componentsList, {
children: [],
style: element.style,
visible: "",
- slots: {},
+ slots: element.slots,
disable: "",
events: {},
loop: {},