This commit is contained in:
lhj
2024-11-09 01:18:32 +08:00
parent 898f2c3b34
commit 87d5c1fe30
8 changed files with 44 additions and 28 deletions

View File

@ -1,9 +1,9 @@
<template>
<div>
<div style="overflow-y: scroll">
<div style="width: 100%;">
<slot name="header"></slot>
</div>
<div style="width: 100%;min-height: 480px;background-color: #f7f8fa;">
<div style="width: 100%;height: 100%;background-color: #f7f8fa;">
<slot>
MAIN
</slot>

View File

@ -1,12 +1,12 @@
<template>
<component @click.stop="handleClick" :id="componentId" :is="componentType" v-bind="componentProps"
<component v-if="componentVisible" @click.stop="handleClick" :id="componentId" :is="componentType" v-bind="componentProps"
:class="componentClass" :style="componentStyle">
{{ componentText }}
<template v-for="child in componentChildren" :key="child.id">
<DynamicComponent :component-data="child" />
</template>
<template v-for="(slot, key, index) in componentSlots" :key="index" v-slot:[key]>
<DynamicComponent :component-data="slot" />
<DynamicComponent :componentData="slot" />
</template>
</component>
</template>
@ -21,18 +21,23 @@ const props = defineProps({
});
onMounted(() => {
// console.log(props.componentData)
console.log(props.componentData)
})
const componentId = computed(() => props.componentData?.id || '');
const componentType = computed(() => componentMapping[props.componentData?.type] || 'div');
const componentProps = computed(() => props.componentData?.props || {});
const componentDisable = computed(() => props.componentData?.disable || false);
const componentVisible = computed(() => props.componentData?.visible || true);
const componentChildren = computed(() => props.componentData?.children || []);
const componentText = computed(() => props.componentData?.text || '');
const componentClass = computed(() => props.componentData?.class || []);
const componentStyle = computed(() => props.componentData?.style || []);
const componentSlots = computed(() => props.componentData?.slots || []);
console.log("disabled", componentDisable.value);
componentProps.value['disabled'] = componentDisable.value
// @ts-ignore
const updateScheme = () => {

View File

@ -1,5 +1,4 @@
// componentMapping.ts
import TestComponent from './TestComponent.vue';
import AdaptivePage from './AdaptivePage.vue';
import Icon from './Icon.tsx';
@ -31,8 +30,7 @@ import {
} from '@arco-design/web-vue';
export const componentMapping: { [key: string]: any } = {
TestComponent, AdaptivePage,
Affix, Alert, Anchor, AnchorLink,
AdaptivePage, Affix, Alert, Anchor, AnchorLink,
AutoComplete, Avatar, AvatarGroup, BackTop,
Badge, Breadcrumb, BreadcrumbItem, Button,
ButtonGroup, Card, CardGrid, CardMeta,

View File

@ -3,15 +3,19 @@
"name": "link",
"id": "link",
"designer": {},
"text": "Link",
"text": "链接",
"props": {
"status":""
"status":"normal",
"href": "https://www.baidu.com",
"loading": false,
"hoverable": "",
"icon": false
},
"style": "",
"class": "",
"visible": "",
"visible": true,
"slots": {},
"disable": "",
"disable": true,
"events": {},
"loop": {},
"children": []

View File

@ -724,15 +724,19 @@
"name": "link",
"id": "link",
"designer": {},
"text": "Link",
"text": "链接",
"props": {
"status": ""
"status": "normal",
"href": "https://www.baidu.com",
"loading": false,
"hoverable": "",
"icon": false
},
"style": "",
"class": "",
"visible": "",
"visible": "true",
"slots": {},
"disable": "",
"disable": "true",
"events": {},
"loop": {},
"children": []

View File

@ -724,15 +724,19 @@ export const componentScheme = {
"name": "link",
"id": "link",
"designer": {},
"text": "Link",
"text": "链接",
"props": {
"status": ""
"status": "normal",
"href": "https://www.baidu.com",
"loading": false,
"hoverable": "",
"icon": false
},
"style": "",
"class": "",
"visible": "",
"visible": "true",
"slots": {},
"disable": "",
"disable": "true",
"events": {},
"loop": {},
"children": []