Vue. How to get a value of a "key" attribute in created element
you don't need to use an extra attribute. You can get the key by
this.$vnode.key
In Vue 3 you can get the key with:
import { getCurrentInstance} from "vue";
getCurrentInstance().vnode.key