arrow.vue 1000 Bytes
<!--
 * @Date: 2025-03-10 16:52:35
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2025-03-12 16:16:06
 * @FilePath: /logic-flow2/src/views/edge/arrow.vue
 * @Description: 自定义箭头
-->
<template>
  <div class="container">
    <div ref="container" class="flow-container"></div>
  </div>
</template>

<script setup>
import LogicFlow from "@logicflow/core";
import CustomArrow from "./customArrow";
import data from "./data4";

const container = ref(null);
let lf = null;

onMounted(() => {
  lf = new LogicFlow({
    container: container.value,
    grid: true,
    edgeType: 'custom-arrow',
    adjustEdge: true,  // 开启边的调整功能
    adjustEdgeStartAndEnd: true,  // 允许调整边的起终点
  });

  lf.register(CustomArrow);
  lf.render(data);
  lf.translateCenter();
});
</script>

<style scoped>
.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.flow-container {
  flex: 1;
  width: 100%;
  height: 100%;
}
</style>