feat: 新增数据池 hook

This commit is contained in:
奔跑的面条
2022-11-15 21:25:35 +08:00
parent 8c089b800a
commit 48f00e44f6
8 changed files with 143 additions and 15 deletions
@@ -10,7 +10,7 @@
...getTransformStyle(item.styles),
...getStatusStyle(item.status),
...getBlendModeStyle(item.styles) as any
} as any"
}"
>
<!-- 分组 -->
<preview-render-group
@@ -36,7 +36,8 @@
</template>
<script setup lang="ts">
import { PropType, computed } from 'vue'
import { PropType, computed, onMounted } from 'vue'
import { useChartDataPondFetch } from '@/hooks'
import { ChartEditStorageType } from '../../index.d'
import { PreviewRenderGroup } from '../PreviewRenderGroup/index'
import { CreateComponentGroupType } from '@/packages/index.d'
@@ -45,6 +46,9 @@ import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle }
import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils'
import { useLifeHandler } from '@/hooks'
// 初始化数据池
const { initDataPond } = useChartDataPondFetch()
const props = defineProps({
localStorageInfo: {
type: Object as PropType<ChartEditStorageType>,
@@ -63,6 +67,11 @@ const themeColor = computed(() => {
const chartThemeColor = props.localStorageInfo.editCanvasConfig.chartThemeColor
return chartColors[chartThemeColor]
})
// 组件渲染结束初始化数据池
onMounted(() => {
initDataPond(props.localStorageInfo.requestGlobalConfig)
})
</script>
<style lang="scss" scoped>