[Vuejs]-Vue.js: When rendering vue on a page inside a frame, the style tag is ignored

1👍

Temporary solution:

let frame = document.getElementById('frm') as any;
let element = frame.contentWindow.document.getElementById('app');
createApp(App).mount(element)

// solution
document.querySelectorAll('style').forEach((style) => {
    frame.contentWindow.document.head.appendChild(style.cloneNode(true));
});

Leave a comment