This commit is contained in:
lzp
2026-03-02 14:10:32 +08:00
parent 6939fdbeb1
commit bbefaddad0

View File

@@ -1,15 +1,13 @@
<template>
<div class="node start" :class="{ center: posCenter }">
<template v-if="type === NODE_TYPE.INPUT">
<Handle type="source" id="Right" :position="Position.Right" />
</template>
<template v-else-if="type === NODE_TYPE.SECONDARY">
<Handle type="target" id="Left" :position="Position.Left" />
<Handle type="source" id="Right" :position="Position.Right" />
</template>
<template v-else-if="type === NODE_TYPE.OUTPUT">
<Handle type="target" id="Left" :position="Position.Left" />
</template>
<Handle
v-for="handle in handles[type]"
:key="handle.id"
:type="handle.type"
:id="handle.id"
:position="handle.position"
:connectable="false"
/>
<div class="item">
<slot></slot>
</div>
@@ -22,7 +20,15 @@
import { Handle, Position } from '@vue-flow/core'
import { NODE_TYPE } from '../tools/index.d'
import { NODE_DATATYPE, NODE_DATATIER } from '../tools/index.d'
import { computed } from 'vue'
import { computed, ref } from 'vue'
const handles = ref({
[NODE_TYPE.INPUT]: [{ id: 'Right', type: 'source', position: Position.Right }],
[NODE_TYPE.SECONDARY]: [
{ id: 'Left', type: 'target', position: Position.Left },
{ id: 'Right', type: 'source', position: Position.Right }
],
[NODE_TYPE.OUTPUT]: [{ id: 'Left', type: 'target', position: Position.Left }]
})
const props = defineProps({
type: {
type: String,