<script  setup>
import { ref, onMounted, reactive, } from "vue";
import { VueFlow,Handle, useVueFlow,Position } from '@vue-flow/core'
const props = defineProps({
  node: {
    type: Object,
    required: true,
  },
  sourcePosition: {
    type: String,
  },
  targetPosition: {
    type: String,
  },
})
onMounted(() => {
});
</script>
<template>
 
  <div v-if="props.node.data!=null">
    <div class="custom-node icons" :id="`node-${node.id}`"  >
    <img :src="props.node.data.image" alt="节点图片" />
    <span>{{props.node.data.label }}</span>
  </div>
  <Handle type="source" :position="Position.Right"  />
  <Handle id="target-c" type="source" :position="Position.Top"  /> 
   <Handle id="target-b" type="target"  :position="Position.Left" /> 
  <Handle id="target-d" type="target" :position="Position.Bottom"  /> 
  </div>

</template>
<style scoped> 

.icons img{
    width: 26px;

}
.icons span{
  display: block;
  font-size: 8px;
}
</style>
<style>
.vue-flow__node.draggable {
  width: 60px !important;
    height: 58px !important;
    border: none;   
    background-color: rgba(0,0,0,0);
}
.vue-flow__node {
          stroke: none; /* 移除节点边框 */
        }
        
 
.vue-flow__edge-text {
  display: none;
}
.vue-flow__node-custom {
    background: purple;
    color: white;
    border: 1px solid purple;
    border-radius: 4px;
    box-shadow: 0 0 0 1px purple;
    padding: 8px;
}
</style>
