diff options
Diffstat (limited to 'packages/integrations/vue/client.js')
-rw-r--r-- | packages/integrations/vue/client.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/integrations/vue/client.js b/packages/integrations/vue/client.js new file mode 100644 index 000000000..0ba4e8106 --- /dev/null +++ b/packages/integrations/vue/client.js @@ -0,0 +1,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); +}; |