| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <template>
- <div :class="[position, type]" class="renderType flex items-center">
- <div :class="type" class="handlePort transition-transform duration-150 relative"></div>
- <div v-if="label" class="ml-8px text-12px text-#666">{{ label }}</div>
- </div>
- </template>
- <script setup lang="ts">
- defineProps<{
- position: string
- type: 'source' | 'target'
- label?: string
- }>()
- </script>
- <style lang="less" scoped>
- .handlePort {
- width: 12px;
- height: 12px;
- background-color: #fff;
- border: 1px solid #989898;
- border-radius: 50%;
- cursor: default;
- }
- .source:hover {
- transform: scale(1.2);
- border-width: 1.2px;
- cursor: crosshair;
- }
- .renderType {
- &.top {
- margin-bottom: -12px;
- transform: translate(0%, -50%);
- }
- &.right {
- margin-left: -12px;
- transform: translate(50%, 0%);
- }
- &.left {
- margin-right: -12px;
- transform: translate(-50%, 0%);
- }
- &.bottom {
- margin-top: -12px;
- transform: translate(0%, 50%);
- }
- }
- </style>
|