1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <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.label!='模块化'"> -->
- <div v-if="props.node.data!=null">
- <div class="custom-node icons " :id="`node-${node.id}`" >
- <img v-if="props.node.data.label!='模块化'" :src="props.node.data.image"/>
- <span>{{props.node.data.label }}</span>
- </div>
- <Handle v-if="props.node.data.label!='模块化'" type="source" id="target-a" :position="Position.Right" />
- <Handle id="target-c" type="source" :position="Position.Top" />
- <Handle v-if="props.node.data.label!='模块化'" id="target-b" type="source" :position="Position.Left" />
- <Handle id="target-d" type="source" :position="Position.Bottom" />
- </div>
- <!-- </div> -->
- </template>
- <style scoped>
- .icons img{
- width: 26px;
- }
- .icons span{
- display: block;
- font-size: 8px;
- }
- </style>
- <style>
- .vue-flow__node-default, .vue-flow__node-input, .vue-flow__node-output{
- width: 60px;
- height: 58px;
- pointer-events: auto;
- }
- .vue-flow__node-default:not(.selected) {
- z-index: 1 !important; /* 强制设置未选中时的 z-index */
- }
- .vue-flow__node.draggable {
- background-color: rgba(0,0,0,0);
- }
- .vue-flow__node-default.selected, .vue-flow__node-default.selected:hover, .vue-flow__node-input.selected, .vue-flow__node-input.selected:hover, .vue-flow__node-output.selected, .vue-flow__node-output.selected:hover{
- box-shadow:none;
- }
- .vue-flow__node {
- stroke: none; /* 移除节点边框 */
- }
-
-
- .vue-flow__edge-text {
- display: block;
- }
- .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>
|