Closed proyavin closed 3 years ago
Hello @proyavin
Get the id of element with:
const id = this.$el.parentElement.parentElement.id;
View example: https://github.com/jerosoler/Drawflow/issues/37#issuecomment-717822302
And use function getNodeFromId
@jerosoler thank you!
is there any way on doing this with the new composition api?
Hi @zynth17
It's possible:
<template>
<div ref="el">Hola</div>
</template>
<script>
import { onMounted, ref } from 'vue'
export default {
setup() {
const el = ref(null);
onMounted(() => {
console.log(el.value.parentElement.parentElement.id);
});
return {
el
}
}
}
</script>
And view:
https://github.com/jerosoler/Drawflow/issues/102#issuecomment-766333278
Hello @proyavin
Get the id of element with:
const id = this.$el.parentElement.parentElement.id;
View example: #37 (comment)
And use function
getNodeFromId
I'm getting id on this way but trough me an error when drop a new element. I did this on onMounted hook.
View a complete example in https://github.com/jerosoler/Drawflow/issues/263#issuecomment-930449781