temp.vue 930 Bytes
<!--
 * @Date: 2025-03-10 16:52:35
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2025-03-11 15:40:10
 * @FilePath: /logic-flow2/src/views/temp.vue
 * @Description: 拖拽面板
-->
<template>
  <div class="container">
    <div ref="container" class="flow-container"></div>
  </div>
</template>

<script setup>
import LogicFlow from '@logicflow/core';

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

onMounted(() => {
  lf = new LogicFlow({
    container: container.value,
    grid: true,
  });

  lf.render({
    nodes: [
      { id: 'node1', type: 'rect', x: 200, y: 100 },
      { id: 'node2', type: 'circle', x: 400, y: 100 },
    ],
    edges: [{ id: 'edge1', sourceNodeId: 'node1', targetNodeId: 'node2' }],
  });
});
</script>


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

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