wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
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
<script setup lang="ts">
import { toRefs } from 'vue'
const props = defineProps({
  start: {
    type: Object,
    default() {
      return {
        x: null,
        y: null
      }
    }
  },
  width: {
    type: Number,
    default: 0
  },
  height: {
    type: Number,
    default: 0
  }
})
 
const { start, width, height } = toRefs(props)
</script>
 
<template>
  <div
    :style="{
      left: start?.x + 'px',
      top: start?.y + 'px',
      width: width + 'px',
      height: height + 'px'
    }"
    class="area"
  ></div>
</template>
<style lang="less" scoped>
.area {
  border: 1px solid #70c0ff;
  position: absolute;
  // 选中区域图层最高 内部组件暂不可进行实际触发
  z-index: 15;
}
</style>