butterfly
butterfly copied to clipboard
fix: `type` and `Class` are overridden in object spread
When trying to use the components from the butterfly-vue
and butterfly-react
, the supplied type
and Class
properties are being overridden and don't work as intended.
For example:
export default {
nodes: [
{
id: '1',
label: '张三',
left: 600,
top: 50,
iconType: 'icon-wo',
Class: CustomNode,
endpoints: [
{
id: 'right',
orientation: [1, 0],
pos: [0, 0.5],
},
{
id: 'bottom',
orientation: [0, 1],
pos: [0.5, 0],
},
{
id: 'left',
orientation: [-1, 0],
pos: [0, 0.5],
},
],
},
...
],
...
}
The node won't be the CustomNode
, but the default Node
.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
I don't think is not a good solution to solve this problem. Cause I have rewrited BaseNode.click
for the reason of emit node click event to React Element
in render
.