Skip to content

Commit 4e27dc8

Browse files
author
zhanbo.lh
committed
feat: 增加通用节点渲染能力
1 parent 054a635 commit 4e27dc8

File tree

1 file changed

+4
-13
lines changed
  • packages/x-flow/src/components/CandidateNode

1 file changed

+4
-13
lines changed

packages/x-flow/src/components/CandidateNode/index.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ const CandidateNode = () => {
3131
}))
3232
);
3333

34-
35-
console.log(candidateNode, 'candidateNode+++')
36-
3734
useEventListener('click', (ev) => {
3835
if (!candidateNode) {
3936
return;
@@ -56,27 +53,21 @@ const CandidateNode = () => {
5653
setCandidateNode(null);
5754
});
5855

59-
useEventListener('contextmenu', (e) => {
60-
// const { candidateNode } = workflowStore.getState()
61-
// if (candidateNode) {
62-
// e.preventDefault()
63-
// workflowStore.setState({ candidateNode: undefined })
64-
// }
65-
})
66-
6756
if (!candidateNode) {
6857
return null
6958
}
59+
60+
console.log(mousePosition, '=======000000')
7061

7162
return (
7263
<div
73-
className='absolute z-10'
7464
style={{
75-
zIndex: 100,
7665
left: mousePosition?.elementX,
7766
top: mousePosition?.elementY,
7867
transform: `scale(${zoom})`,
7968
transformOrigin: '0 0',
69+
position: 'absolute',
70+
zIndex: 10000
8071
}}
8172
>
8273
<CustomNode {...candidateNode as any} type={candidateNode?.data?._nodeType } />

0 commit comments

Comments
 (0)