We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`刚开始以为是左边图表没有加载好,然后加载完毕之后还是不能拖动(刷新之后),但是更改代码让代码热更新之后是可以拖动到右边的。 不太清楚是哪里出了问题 注册左边图形代码
async getDevices() { getDevice().then(async res => { await registerShape(G6,res.data); registerBehavior(G6); setTimeout(function() { this.devices = _.groupBy(res.data,'typeId') }.bind(this),500) }) },
initPlugin(graph) { // 确保图片加载完毕 let timer = setInterval(function() { const parentNode = this.get('container'); const ghost = createDom('<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"' + ' style="opacity:0"/>'); const children = parentNode.querySelectorAll('.itemPanel img[data-item]') if (children.length) { if (Array.from(children).every(img => img.height > 0)) { setTimeout(function() { each(children,(child,i) => { const addModel = (new Function("return " + child.getAttribute('data-item')))(); child.addEventListener('dragstart',e => { console.log(addModel,'点击!') e.dataTransfer.setDragImage(ghost,0,0); graph.set('addNodeDragging',true); graph.set('addModel',addModel); }); child.addEventListener('dragend',e => { graph.emit('canvas:mouseup',e); graph.set('addNodeDragging',false); graph.set('addModel',null); }); }) }.bind(this),500) clearInterval(timer) } } }.bind(this),1000) }
The text was updated successfully, but these errors were encountered:
``
这个是两个graph 对象,第一个是正常的,第二张是所说的问题。
Sorry, something went wrong.
registerShape(G6) registerBehavior(G6) 这两个方法 重新注册下试试
好像可以了
你好,我也遇到了同样的问题,请问怎么解决的
加载顺序问题,按照上面的办法试试
No branches or pull requests
`刚开始以为是左边图表没有加载好,然后加载完毕之后还是不能拖动(刷新之后),但是更改代码让代码热更新之后是可以拖动到右边的。 不太清楚是哪里出了问题 注册左边图形代码
![image](https://user-images.githubusercontent.com/20988336/103747926-53db2f80-503e-11eb-927b-df969bd8f7e4.png)
async getDevices() { getDevice().then(async res => { await registerShape(G6,res.data); registerBehavior(G6); setTimeout(function() { this.devices = _.groupBy(res.data,'typeId') }.bind(this),500) }) },
initPlugin(graph) { // 确保图片加载完毕 let timer = setInterval(function() { const parentNode = this.get('container'); const ghost = createDom('<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"' + ' style="opacity:0"/>'); const children = parentNode.querySelectorAll('.itemPanel img[data-item]') if (children.length) { if (Array.from(children).every(img => img.height > 0)) { setTimeout(function() { each(children,(child,i) => { const addModel = (new Function("return " + child.getAttribute('data-item')))(); child.addEventListener('dragstart',e => { console.log(addModel,'点击!') e.dataTransfer.setDragImage(ghost,0,0); graph.set('addNodeDragging',true); graph.set('addModel',addModel); }); child.addEventListener('dragend',e => { graph.emit('canvas:mouseup',e); graph.set('addNodeDragging',false); graph.set('addModel',null); }); }) }.bind(this),500) clearInterval(timer) } } }.bind(this),1000) }
The text was updated successfully, but these errors were encountered: