wangrong
2026-08-30 4c949c0dc9bcae785c281c9d8125295f09810b15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
  <div class="hang-main" @keydown.stop @keyup.stop>
    <div :key="index" v-for="(config, index) in hangComponentData">
      <component
        :is="findComponent(config['component'])"
        :view="canvasViewInfo[config['id']]"
        ref="component"
        class="component"
        :element="config"
        :scale="deepScale"
      />
    </div>
  </div>
</template>
 
<script setup lang="ts">
import { computed, toRefs } from 'vue'
import findComponent from '@/utils/components'
const props = defineProps({
  hangComponentData: {
    type: Object,
    required: true
  },
  canvasViewInfo: {
    type: Object,
    required: true
  },
  scale: {
    type: Number,
    required: false,
    default: 100
  }
})
 
const { hangComponentData, scale } = toRefs(props)
const deepScale = computed(() => scale.value / 100)
</script>
 
<style lang="less" scoped>
.hang-main {
  overflow: auto;
  width: 100%;
  height: 300px;
}
</style>