fix empty template error
This commit is contained in:
parent
2728700a95
commit
809a0b8014
2 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lightweight-sdk/web-component",
|
"name": "@lightweight-sdk/web-component",
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"description": "A lightweight library to build web components easily",
|
"description": "A lightweight library to build web components easily",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -b",
|
"build": "tsc -b",
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,6 @@ export function findRefElement(ref: string, parent?: HTMLElement): HTMLElement |
|
||||||
* @returns the template as a string
|
* @returns the template as a string
|
||||||
*/
|
*/
|
||||||
export function parseModuleToHtml(mod: any): string {
|
export function parseModuleToHtml(mod: any): string {
|
||||||
|
if (mod == null) return "";
|
||||||
return "default" in mod ? mod.default as string : "";
|
return "default" in mod ? mod.default as string : "";
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue