While working on a Chrome extension, I initially used jQuery but due to some reactivity issues, I had to switch to Vuejs.
When I bind Vue to a random div, the content inside that div gets removed automatically.
To work around this issue, I tried appending a new element and using that instead. However, Vue seemed unable to locate it.
let el = document.createElement('div');
el.style.cssText = 'position:fixed;top:0;left:0;';
el.id = '#random12345';
document.body.appendChild(el);
setTimeout(function () {
const app = new Vue({
el: "#random12345",
data: {},
render: h => h('some-component')
});
}, 3000);
But I consistently encountered an error message stating: [Vue warn]: Cannot find element: #random12345