You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although we are just using Light DOM for the header and footer, e.g.
exportdefaultclassHeaderComponentextendsHTMLElement{// run some code to set HTML when the component is readyconnectedCallback(){this.innerHTML=this.getTemplate();}// create templates that interpolate variables and HTML!getTemplate(){return` <!-- a bunch of HTML --> `;}}customElements.define('app-header',HeaderComponent);
It would likely be a bit more idiomatic to use a <template> tag
consttemplate=document.createElement('template');template.innerHTML=` <!-- a bunch of HTML -->`;exportdefaultclassHeaderComponentextendsHTMLElement{// run some code to set HTML when the component is readyconnectedCallback(){this.innerHTML=template.content.cloneNode(true);// or something similar}}customElements.define('app-header',HeaderComponent);
Overview
Although we are just using Light DOM for the header and footer, e.g.
It would likely be a bit more idiomatic to use a
<template>
tagWould also want to make sure this change is reflected in the Greenwood getting started guide
https://www.greenwoodjs.io/getting-started/branding/#templating
The text was updated successfully, but these errors were encountered: