SpecialNode.vue 681 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div class="vue-flow__node-default">
  3. <div>
  4. <el-tag>{{ data.type }}</el-tag>
  5. {{ data.label }}
  6. </div>
  7. <Handle type="source" :position="Position.Right"/>
  8. <Handle type="target" :position="Position.Left"/>
  9. </div>
  10. </template>
  11. <script setup>
  12. import {computed} from 'vue'
  13. import {Handle, Position} from '@vue-flow/core'
  14. const props = defineProps({
  15. id: {
  16. type: String,
  17. required: true,
  18. },
  19. data: {
  20. type: Object,
  21. required: true,
  22. },
  23. position: {
  24. type: Object,
  25. required: true,
  26. }
  27. })
  28. const x = computed(() => `${Math.round(props.position.x)}px`)
  29. const y = computed(() => `${Math.round(props.position.y)}px`)
  30. </script>