<BaseEdge />
<BaseEdge />
元件在內部用於所有邊緣。它可以用在自訂邊緣內部,並為您處理不可見的輔助邊緣和邊緣標籤。
CustomEdge.svelte
<script lang="ts">
import { BaseEdge, getStraightPath } from '@xyflow/svelte';
const [edgePath] = getStraightPath({
sourceX,
sourceY,
targetX,
targetY,
});
</script>
<BaseEdge path={edgePath} {...$$props} />
Props
名稱 | 類型 |
---|---|
# id | string |
# interactionWidth | number |
# path | string |
# style | string |
# class | string |
# markerStart | string |
# markerEnd | string |
# label | string |
# labelX | number |
# labelY | number |
# labelStyle | string |
注意事項
- 如果您想在
<BaseEdge />
元件中使用邊緣標記,您可以將傳遞到自訂邊緣的markerStart
或markerEnd
props 傳遞到<BaseEdge />
元件。您可以透過查看EdgeProps
類型來查看傳遞給自訂邊緣的所有 props。