fix: 处理分组预览和动态引入的问题

This commit is contained in:
奔跑的面条
2022-08-12 20:39:20 +08:00
parent 57798b9000
commit e380ead651
6 changed files with 137 additions and 35 deletions
@@ -0,0 +1,55 @@
<template>
<div
class="chart-item"
v-for="item in groupData.groupList"
:class="animationsClass(item.styles.animations)"
:key="item.id"
:style="{
...getComponentAttrStyle(item.attr, groupIndex),
...getFilterStyle(item.styles),
...getTransformStyle(item.styles)
}"
>
<component
:is="item.chartConfig.chartKey"
:chartConfig="item"
:themeSetting="themeSetting"
:themeColor="themeColor"
:style="{...getSizeStyle(item.attr)}"
></component>
</div>
</template>
<script setup lang="ts">
import { PropType } from 'vue'
import { CreateComponentGroupType } from '@/packages/index.d'
import { animationsClass, getFilterStyle, getTransformStyle } from '@/utils'
import { getSizeStyle, getComponentAttrStyle } from '../../utils'
const props = defineProps({
groupData: {
type: Object as PropType<CreateComponentGroupType>,
required: true
},
themeSetting: {
type: Object,
required: true
},
themeColor: {
type: Object,
required: true
},
groupIndex: {
type: Number,
required: true
}
})
console.log(props.groupData)
</script>
<style lang="scss" scoped>
.chart-item {
position: absolute;
}
</style>