Prevent passing class to Vue components

This commit is contained in:
Matthew Phillips 2021-10-25 14:07:00 -04:00
parent 303f32fda0
commit 1103cb1f9d

View file

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