You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
在我自己的项目内引用了designable/formily-antd包,在使用中发现网格布局下的网格列数字了跨列数后无法正确显示跨列,经过排查,发现是DroppableWidget类代码,在npm上面的包lib和src和git仓库上的代码不一致导致的。
这是npm下载到的DroppableWidget代码:
DroppableWidget的return在npm上面是这样写的:
return ( <div {...nodeId} className={className} style={style}> {hasChildren ? ( props.children ) : placeholder ? ( <div style={{ height }} className="dn-droppable-placeholder"> <NodeTitleWidget node={target} /> </div> ) : ( props.children )} {actions?.length ? ( <NodeActionsWidget> {actions.map((action, key) => ( <NodeActionsWidget.Action {...action} key={key} /> ))} </NodeActionsWidget> ) : null} </div> )
在源码里面是这样的:
return ( <div {...nodeId} {...props} className={className} style={style}> {hasChildren ? ( props.children ) : placeholder ? ( <div style={{ height }} className="dn-droppable-placeholder"> <NodeTitleWidget node={target} /> </div> ) : ( props.children )} {actions?.length ? ( <NodeActionsWidget> {actions.map((action, key) => ( <NodeActionsWidget.Action {...action} key={key} /> ))} </NodeActionsWidget> ) : null} </div> )
在设置跨列数的时候,会通过props给div添加data-grid-span属性,但是在npm包的代码里面缺失了 {...props},导致data-grid-span缺失,引起设计器里面设置跨列后无法正常显示跨列后的效果。
请小组更新一下npm上面的包
@janryWang
Beta Was this translation helpful? Give feedback.
All reactions