Created
September 2, 2022 19:10
-
-
Save robwormald/f3b21763370278ed82471e1b498fbbe1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customElements.define('app-shell', class extends HTMLElement { | |
constructor(){ | |
super(); | |
this.attachShadow({mode: 'open'}); | |
this.shadowRoot.innerHTML = ` | |
<h1>App</h1> | |
<slot></slot> | |
` | |
} | |
}); | |
customElements.define('home-page', class extends HTMLElement { | |
constructor(){ | |
super(); | |
this.attachShadow({mode: 'open'}); | |
this.shadowRoot.innerHTML = ` | |
<h1>Home</h1> | |
<slot></slot> | |
` | |
} | |
}); | |
customElements.define('about-page', class extends HTMLElement { | |
constructor(){ | |
super(); | |
this.attachShadow({mode: 'open'}); | |
this.shadowRoot.innerHTML = ` | |
<h1>About</h1> | |
<slot></slot> | |
` | |
} | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<app-shell></app-shell> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
name: 'home', | |
component: 'home-page', | |
url: 'home' | |
} | |
{ | |
name: 'about', | |
component: 'about-page', | |
url: 'home' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment