修复首次打开画布无法加载节点问题
This commit is contained in:
@@ -54,6 +54,7 @@ export class NodeManager {
|
||||
return current.data.createIndexPosition > max.data.createIndexPosition ? current : max
|
||||
}, superiorGenerateNodes[0])
|
||||
const snode = superiorID ? this.stateManager.flowManager.getNodeById(superiorID) : this.stateManager.flowManager.getLastNode();
|
||||
console.log(snode)
|
||||
const id = options.id || createId()
|
||||
const positionX = options.positionX || 0
|
||||
const positionY = options.positionY || 0
|
||||
@@ -65,10 +66,14 @@ export class NodeManager {
|
||||
{
|
||||
x: endGenerateNode.position.x + positionX,
|
||||
y: endGenerateNode.position.y + positionY + this.ranksep + 200
|
||||
} :
|
||||
} : snode ?
|
||||
{
|
||||
x: snode.position.x + snode.dimensions.width + this.nodesep + positionX,
|
||||
y: snode.position.y + positionY
|
||||
} :
|
||||
{
|
||||
x: positionX,
|
||||
y: positionY
|
||||
}
|
||||
)
|
||||
const data = options?.data || {}
|
||||
|
||||
@@ -226,10 +226,9 @@ defineExpose({push})
|
||||
margin-bottom: 2rem;
|
||||
background-color: #ffffff;
|
||||
cursor: pointer;
|
||||
pointer-events: none;
|
||||
display: none;
|
||||
&.active{
|
||||
pointer-events: auto;
|
||||
display: none;
|
||||
display: flex;
|
||||
}
|
||||
&:hover{
|
||||
background-color: #f5f5f5;
|
||||
|
||||
Reference in New Issue
Block a user