Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vue-flow-editor
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-11-21 11:05:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a6e1388aa8809439a6a265040f6cf98da4ed8b8b
a6e1388a
1 parent
b4f8492c
fix 修复为节点自定义ID后,节点和连接线显示不正常的问题
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
doc/App.vue
doc/App.vue
View file @
a6e1388
...
...
@@ -2,7 +2,7 @@
<div class="app" style="height: 100vh">
<vue-flow-editor
ref="editor"
menuWidth="
18
0px"
menuWidth="
20
0px"
modelWidth="300px"
:data="state.data"
:grid="showGrid"
...
...
@@ -1004,6 +1004,11 @@ export default {
}
}
}
// TODO: 测试更新ID, 需要在添加前更新ID,不然会导致添加连接线时ID不一致。
model.id = String(new Date().getTime());
editor.updateModel(model);
state.data.nodes = editor.editorState.graph.save().nodes
}
}
...
...
@@ -1016,9 +1021,6 @@ export default {
function handleAfterAdd(model: myObj, type: string) {
if (type === 'node') {
console.log(`新增节点`)
// TODO: 测试更新ID,窗口变化时连接线会消失,但是只有单独操作一次的时候才会发生,如果多次生成连接线不会发生。
model.id = String(new Date().getTime());
editor.updateModel(model);
state.data.nodes = editor.editorState.graph.save().nodes
}
if (type === 'edge') {
...
...
Please
register
or
login
to post a comment