how can I read the updated content in a custom node after [ updateNode ] #1422
Answered
by
bcakmakoglu
lindaoling
asked this question in
Q&A
-
a custom node like <template>
<div>
<slot name="label">custom node:{{ data.label }}</slot>
</div>
</template>
<script setup>
defineProps({
data: {
type: Object,
required: true,
},
})
</script> use it <VueFlow>
<template #node-custom="nodeProps">
<CustomNode :data="nodeProps" />
</template>
</VueFlow> update by updateNode updateNode('1',{label:'new label'}) it work when i use default node |
Beta Was this translation helpful? Give feedback.
Answered by
bcakmakoglu
May 29, 2024
Replies: 1 comment
-
You're not passing the data object as props, that's your mistake. So if you wanna pass the data object as a prop you need to do |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bcakmakoglu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're not passing the data object as props, that's your mistake.
nodeProps
is an object of typeNodeProps
So if you wanna pass the data object as a prop you need to do
<CustomNode :data="nodeProps.data" />
.