astro/packages/renderers/renderer-vue/client.js
Levi 31d0688016
Expose Vue component names for devtools (#1512)
* Expose name on host component for Vue devtools

* Add changeset

* Update changeset to patch from minor

* [ci] collect stats

* [ci] collect stats

Co-authored-by: leviceccato <leviceccato@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
2021-10-14 15:08:07 -04:00

9 lines
426 B
JavaScript

import { h, createSSRApp } from 'vue';
import StaticHtml from './static-html.js';
export default (element) => (Component, props, children) => {
// Expose name on host component for Vue devtools
const name = Component.name ? `${Component.name} Host` : undefined;
const app = createSSRApp({ name, render: () => h(Component, props, { default: () => h(StaticHtml, { value: children }) }) });
app.mount(element, true);
};