While I am trying to utilize Vue.js to access the DOM, the code I have written within the mounted() lifecycle is not producing any results. Interestingly enough, the same code functions perfectly fine when using vanilla JavaScript.
I have incorporated the v-html directive to inject HTML content into the span tag:
<span class="email" v-html="text"></span>
Within the mounted lifecycle block:
mounted() {
let images = document.getElementsByClassName(
"mcnImageCardBottomImageContent"
);
console.log(images); // However, it appears to be returning an empty array
},
Any suggestions on how to effectively access the DOM in Vue.js?