refactor(core): inherit attrs on edge path el in BaseEdge (#1742)
* refactor(core): inherit attrs on edge path el in base edge Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Inherit attributes on main edge path element in BaseEdge component.
|
||||||
@@ -3,7 +3,7 @@ import { ref, useAttrs } from 'vue'
|
|||||||
import type { BaseEdgeProps } from '../../types'
|
import type { BaseEdgeProps } from '../../types'
|
||||||
import EdgeText from './EdgeText.vue'
|
import EdgeText from './EdgeText.vue'
|
||||||
|
|
||||||
const { interactionWidth = 20, labelShowBg = true, ...props } = defineProps<BaseEdgeProps>()
|
withDefaults(defineProps<BaseEdgeProps>(), { interactionWidth: 20 })
|
||||||
|
|
||||||
const pathEl = ref<SVGPathElement | null>(null)
|
const pathEl = ref<SVGPathElement | null>(null)
|
||||||
|
|
||||||
@@ -30,12 +30,11 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<path
|
<path
|
||||||
|
v-bind="attrs"
|
||||||
:id="id"
|
:id="id"
|
||||||
ref="pathEl"
|
ref="pathEl"
|
||||||
:d="path"
|
:d="path"
|
||||||
:style="props.style"
|
|
||||||
class="vue-flow__edge-path"
|
class="vue-flow__edge-path"
|
||||||
:class="attrs.class"
|
|
||||||
:marker-end="markerEnd"
|
:marker-end="markerEnd"
|
||||||
:marker-start="markerStart"
|
:marker-start="markerStart"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -201,7 +201,6 @@ export interface BaseEdgeProps extends EdgeLabelOptions {
|
|||||||
markerStart?: string
|
markerStart?: string
|
||||||
markerEnd?: string
|
markerEnd?: string
|
||||||
interactionWidth?: number
|
interactionWidth?: number
|
||||||
style?: CSSProperties
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BezierEdgeProps = EdgePositions &
|
export type BezierEdgeProps = EdgePositions &
|
||||||
|
|||||||
Reference in New Issue
Block a user