refactor(core): use normal components for edges

This commit is contained in:
braks
2023-07-10 19:20:26 +02:00
committed by Braks
parent 908ea3965e
commit 7d93915f36
5 changed files with 173 additions and 181 deletions
+24 -27
View File
@@ -1,31 +1,28 @@
import type { FunctionalComponent } from 'vue'
import { h } from 'vue'
import { defineComponent, h } from 'vue'
import SmoothStepEdge from './SmoothStepEdge'
import type { StepEdgeProps } from '~/types'
const StepEdge: FunctionalComponent<StepEdgeProps> = function (props, { attrs }) {
return h(SmoothStepEdge, { ...props, ...attrs, borderRadius: 0 })
}
StepEdge.props = [
'sourcePosition',
'targetPosition',
'label',
'labelStyle',
'labelShowBg',
'labelBgStyle',
'labelBgPadding',
'labelBgBorderRadius',
'sourceY',
'sourceX',
'targetX',
'targetY',
'markerEnd',
'markerStart',
'interactionWidth',
]
StepEdge.inheritAttrs = false
StepEdge.compatConfig = { MODE: 3 }
const StepEdge = defineComponent({
name: 'StepEdge',
props: [
'sourcePosition',
'targetPosition',
'label',
'labelStyle',
'labelShowBg',
'labelBgStyle',
'labelBgPadding',
'labelBgBorderRadius',
'sourceY',
'sourceX',
'targetX',
'targetY',
'markerEnd',
'markerStart',
'interactionWidth',
] as any,
setup(props, { attrs }) {
return () => h(SmoothStepEdge as any, { ...props, ...attrs, borderRadius: 0 })
},
})
export default StepEdge