Closed SangRyul closed 3 years ago
Hello @SangRyul
Do you import the vue component before importing?
@jerosoler hello. Yes I imported vue component at the head of script file in the single file component, and I checked it works, but when I export the data and import again, The plot doesn't showed. I think export data and import data don't contain the structure of vue file(cf. html mode works)
Is there an error displayed on the console?
var exportvalue = null;
exportvalue = editor.export();
editor.import(exportvalue);
Does this work for you? Or does it give you an error?
I faced a similar problem where after import the value in Vue it will not update the df- fields when I export it again. I could realise it will only properly update if I change it by hand.
So, I made a quick hack about it:
<template>
<sender-node>
<input type="hidden" df-template_id ref="template_id" id="template_id" />
<input type="hidden" df-template_name ref="template_name" id="template_name" />
</sender-node>
</template>
<script>
import SenderNode from "@/Flow/Nodes/SenderNode";
export default {
components: {
SenderNode,
},
props: {
data: Object,
},
mounted() {
this.$nextTick(() => {
this.data.template_id = this.$refs.template_id.value
this.data.template_name = this.$refs.template_name.value
});
},
methods: {
select(template) {
this.data.template_id = template.id
this.data.template_name = template.name
this.$refs.template_id.value = template.id
this.$refs.template_name.value = template.name
this.$refs.template_name.dispatchEvent(new Event('input', {bubbles: true}));
this.$refs.template_id.dispatchEvent(new Event('input', {bubbles: true}));
},
},
}
</script>
Note: The code was cut to keep the important parts, the df fields are updated via a modal that is not important for it.
Which is basically dispatch the input event after update it. Quite dirty, but worked just fine.
hello, I'm trying to make custom node with vue. So I use typenode : 'vue' and import vue component to the node. and It worked.
And then, I tried to export the data and store in database. After that I tried to import data , but it doesn't work.(It deosn't make the graph). I checked It works with html file. ' This is vue version
and this is html version
How can I use the data made by vue?