I defined an undo undo function in the setup of the child component
and then added ref to the child component in the parent component
<CanvaBoard ref="childComponentRef"/>
Then write this in the setup of the parent component
const childComponentRef = ref(null)
const reFundo = function() {
childComponentRef.value.undo();
}
Anyway, I couldn’t find this undo function,
and finally found a solution later
. Add it at the end of the setup of the subcomponent
defineExpose({
undo
});
It would be nice to expose the undo function. It’s quite weird, but it’s a lot of insight.
defineExpose does not need to introduce any dependencies