I would like to ask, I used vue to write the node panel configuration, why after saving, when I click the node again to open the panel, the modified content is not echoed. However, I used native html to write the input tag directly in the script tag, and it can be echoed normally after modification. Is this a vue rendering problem? How should it be solved? I hope to use vue to customize node content
This is the code and node implemented by vue, Cannot display edited content normally
<script
src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.5.12/vue.global.min.js"
defer
integrity="sha512-GQnkp3HbW6BBv2mlZ7ZmzEfJcoaTJSMKBjORQCknW8HbkyV5gmJKSpDp1LLXdJDaZg+pH4/Hx5isR8Eyx6YYsQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/element-plus/2.8.6/index.full.min.js"
defer
integrity="sha512-sIvHq0+PDO52slnEatbyU9IMO0qy/eCLH59I7uRdV3HdkzkPh5moHplaIKDlJzycA6PVk33uzH2JEFc99NURYA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/element-plus/2.8.6/index.min.css"
defer
integrity="sha512-XTVfw+pzDNf5klHnkOWynAiawHWgdC/xqs5yKhs8nOqbdUjaVG59SlJCkAUrtzbmJE9ZCSgyRN9V6iNYaucApA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<script type="text/javascript">
RED.nodes.registerType("vue-node", {
category: "custom",
color: "#a6bbcf",
defaults: {
name: { value: "" },
content: { value: "" },
inputContent: { value: "" },
},
inputs: 1,
outputs: 1,
icon: "file.svg",
label: function () {
return this.name || "vue-node";
},
oneditprepare() {
const app = Vue.createApp({
template: `<el-input v-model="content" id="node-input-content"></el-input>
<input v-model="inputContent" type="text" id="node-input-inputContent" placeholder="inputContent's input" />
`,
setup() {
return {
content: Vue.ref("content"),
inputContent: Vue.ref("inputContent"),
};
},
});
app.use(ElementPlus);
app.mount("#appPage");
},
});
</script>
<script type="text/html" data-template-name="vue-node">
<div id="appPage"></div>
</script>
<script type="text/html" data-help-name="vue-node">
<p>描述描述</p>
</script>
This is the code and node of native html implementation, The edited content can be echoed normally
<script
src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.5.12/vue.global.min.js"
defer
integrity="sha512-GQnkp3HbW6BBv2mlZ7ZmzEfJcoaTJSMKBjORQCknW8HbkyV5gmJKSpDp1LLXdJDaZg+pH4/Hx5isR8Eyx6YYsQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/element-plus/2.8.6/index.full.min.js"
defer
integrity="sha512-sIvHq0+PDO52slnEatbyU9IMO0qy/eCLH59I7uRdV3HdkzkPh5moHplaIKDlJzycA6PVk33uzH2JEFc99NURYA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/element-plus/2.8.6/index.min.css"
defer
integrity="sha512-XTVfw+pzDNf5klHnkOWynAiawHWgdC/xqs5yKhs8nOqbdUjaVG59SlJCkAUrtzbmJE9ZCSgyRN9V6iNYaucApA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<script type="text/javascript">
RED.nodes.registerType("vue-node", {
category: "custom",
color: "#a6bbcf",
defaults: {
name: { value: "" },
inputContent: { value: "" },
},
inputs: 1,
outputs: 1,
icon: "file.svg",
label: function () {
return this.name || "vue-node";
},
});
</script>
<script type="text/html" data-template-name="vue-node">
<input
type="text"
id="node-input-inputContent"
placeholder="inputContent's input"
/>
</script>
<script type="text/html" data-help-name="vue-node">
<p>描述描述</p>
</script>