Hello and thank you for taking the time to read my query!
I am currently working in a Vue file, specifically in the App.vue where I am importing an external .js file containing icons. Here is how I import the script:
let recaptchaScript2 = document.createElement('script')
recaptchaScript2.setAttribute('src', '../static/js/uikit-icons.min.js')
document.head.appendChild(recaptchaScript2)
Upon loading the page, the script is indeed loaded but unfortunately, the icons do not display on the page. The elements tab shows that it is empty. Interestingly, when I make a small random alteration to the code, Vue seems to "reload" the page (without actually refreshing it) and voila! The icons finally show up!
I initially thought this could be due to the scripts being reloaded for some unknown reason and are therefore processed after everything else. However, even when I tried delaying the execution of the script loading by 500ms using an interval, the icons still failed to appear.
This has left me pondering - what exactly is going on here? What crucial element am I overlooking?
Once again, thank you for delving into my question!