<div id="app">
<div>
Статья:
<v-remote :html="html"></v-remote>
Футер.
</div>
</div>
const { compile, h, createComponent, watch, createApp, ref } = Vue;
const htmlFromServer = `
<article>
<section>
some text
<v-gallery/>
</section>
</article>
`;
const vGallery = {
template: '<div>[gallety]</div>'
};
const app = createApp({
setup() {
return {
html: htmlFromServer
}
}
});
app.component('v-remote', {
components: {
vGallery
},
props: {
html: {
default: '',
type: String
}
},
setup(props) {
let render = compile(props.html);
watch(() => props.html, (html) => render = compile(html));
return () => h({render});
},
});
app.mount('#app');
This Pen doesn't use any external CSS resources.