Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (renderedComponent.template) {
// if this is a pure template or if we are in hybrid vsg mode,
// we need to set the template up.
data.template = `<div>${renderedComponent.template}</div>`;
}
} catch (e) {
this.handleError(e);
return;
}
data.components = this.components;
if (style) {
// To add the scope id attribute to each item in the html
// this way when we add the scoped style sheet it will be aplied
data._scopeId = `data-${this.scope}`;
addScopedStyle(style, this.scope);
}
if (data.template || data.render) {
this.previewedComponent = data;
} else {
this.handleError({
message:
"[Vue Live] no template or render function specified, you might have an issue in your example"
});
}
}
}