New issue
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
this.drawflow.drawflow is undefined when trying to import file #478
Comments
I see you are using vue. View example with vue 3: Link Summary: const id = document.getElementById("drawflow");
editor.value = new Drawflow(id, Vue, internalInstance.appContext.app._context);
editor.value.start();
editor.value.registerNode('Node1', Node1, {}, {});
editor.value.registerNode('Node2', Node2, {}, {});
editor.value.registerNode('Node3', Node3, {}, {});
editor.value.import({"drawflow":{"Home":{"data":{"5":{"id":5,"name":"Node2","data":{"script":"(req,res) => {\n console.log(req);\n}"},"class":"Node2","html":"Node2","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"6","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]},"output_2":{"connections":[]}},"pos_x":1000,"pos_y":117},"6":{"id":6,"name":"Node1","data":{"url":"localhost/add", "method": "post"},"class":"Node1","html":"Node1","typenode":"vue","inputs":{},"outputs":{"output_1":{"connections":[{"node":"5","output":"input_1"}]}},"pos_x":137,"pos_y":89}}}}}) |
code.flow is text or object? |
Pass link to codesanbox example. |
I've never used Codesandbox before, but this is the link: https://codesandbox.io/s/loving-babbage-mxtwhe |
I don't know why is producing it, but this is the repo link: https://github.com/danielpc12/front-test The project compiles perfect locally |
Where could be the issue? How can i solve it?. Sorry for asking all this things, it's been a lot of weeks trying to solve the problem but can't make it work |
Look to modify the "data" of the nodes to lowercase. "Number" to "number" |
i've exported the file using the editor.export() method.
Then, when i try to load that file, it displays me the error and doesn't load the nodes.
This is the data i'm trying to import:
{
"drawflow": {
"Home": {
"data": {
"1": {
"id": 1,
"name": "Number",
"data": {
"Number": 0
},
"class": "Number",
"html": "Number",
"typenode": "vue",
"inputs": {},
"outputs": {
"output_1": {
"connections": []
}
},
"pos_x": -1445.183349609375,
"pos_y": 115
},
"2": {
"id": 2,
"name": "Number",
"data": {
"Number": 0
},
"class": "Number",
"html": "Number",
"typenode": "vue",
"inputs": {},
"outputs": {
"output_1": {
"connections": []
}
},
"pos_x": -1349.183349609375,
"pos_y": 391
},
"3": {
"id": 3,
"name": "Sub",
"data": {
"Number1": 0,
"Number2": 0,
"Result": 0
},
"class": "Sub",
"html": "Sub",
"typenode": "vue",
"inputs": {
"input_1": {
"connections": []
},
"input_2": {
"connections": []
}
},
"outputs": {
"output_1": {
"connections": []
}
},
"pos_x": -924.183349609375,
"pos_y": 276
}
}
}
}
}
The text was updated successfully, but these errors were encountered: