blob: 0ba4e81063ab74a9db99abaeef1509e0f4524d7a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import { h, createSSRApp } from 'vue';
import StaticHtml from './static-html.js';
export default (element) => (Component, props, children) => {
delete props['class'];
// Expose name on host component for Vue devtools
const name = Component.name ? `${Component.name} Host` : undefined;
const slots = {};
if (children != null) {
slots.default = () => h(StaticHtml, { value: children });
}
const app = createSSRApp({ name, render: () => h(Component, props, slots) });
app.mount(element, true);
};
|