From 58c17580048e03d97ac7bc4671374d32989176c0 Mon Sep 17 00:00:00 2001 From: zhangqiyu2021 Date: Sun, 12 Dec 2021 16:59:39 +0800 Subject: [PATCH 1/2] fix: error menu title and some connect er error --- src/components/ercanvas/index.js | 2 +- src/components/menu/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ercanvas/index.js b/src/components/ercanvas/index.js index 2aadcaa..a177e09 100644 --- a/src/components/ercanvas/index.js +++ b/src/components/ercanvas/index.js @@ -1142,7 +1142,7 @@ export default ({data, dataSource, renderReady, updateDataSource, validateTableS graph.on('edge:mouseleave', ({edge}) => { const sourceNode = edge.getSourceCell(); const targetNode = edge.getTargetCell(); - sourceNode.setProp('sourcePort','', { ignoreHistory : true}); + sourceNode?.setProp('sourcePort','', { ignoreHistory : true}); targetNode?.setProp('targetPort', '', { ignoreHistory : true}); edge.attr('line/stroke', edge.getProp('fillColor') || currentColor.current.fillColor, { ignoreHistory : true}); diff --git a/src/components/menu/index.js b/src/components/menu/index.js index c5e5502..c6863f2 100644 --- a/src/components/menu/index.js +++ b/src/components/menu/index.js @@ -203,7 +203,7 @@ const Menu = React.memo(forwardRef(({contextMenus = [], onContextMenu, fieldName const getMenuItem = (parentMenu, menu = parentMenu, offsetNumber = 0, pI) => { const parentKey = menu === parentMenu ? null : parentMenu[defKey]; const ulDraggable = getDraggable(menu); - const pName = `${getName && getName(menu) || menu[defName]}${menu.type !== 'groups' && `(${menu[children].length})`}`; + const pName = `${getName && getName(menu) || menu[defName]}${menu.type !== 'groups' ? `(${menu[children].length})` : ''}`; return (