Last active
May 31, 2022 07:24
-
-
Save dbwodlf3/87bba669c169e41b782f8ba1b8adbe1b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <!DOCTYPE html> | |
| <head> | |
| <script type="module" src="./test.js"></script> | |
| </head> | |
| <body> | |
| <child-child></child-child> | |
| </body> |
This file contains hidden or 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
| { | |
| "dependencies": { | |
| "lit": "^2.0.0", | |
| "@lit/reactive-element": "^1.0.0", | |
| "lit-element": "^3.0.0", | |
| "lit-html": "^2.0.0" | |
| } | |
| } |
This file contains hidden or 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
| import {html, css, LitElement} from 'lit'; | |
| import {customElement, property} from 'lit/decorators.js'; | |
| @customElement('parent-component') | |
| export class Parent extends LitElement { | |
| static styles = css`p { color: blue }`; | |
| @property() | |
| name = 'Somebody'; | |
| render() { | |
| return html`<p>Hello, ${this.name}!</p>`; | |
| } | |
| connectedCallback(){ | |
| super.connectedCallback(); | |
| console.log("connectedCallback Parent"); | |
| } | |
| } | |
| @customElement('child-component') | |
| export class Child extends LitElement { | |
| static styles = css`p { color: blue }`; | |
| connectedCallback(){ | |
| super.connectedCallback(); | |
| console.log("connectedCallback Child"); | |
| } | |
| render() { | |
| return html`<parent-component></parent-component>`; | |
| } | |
| } | |
| @customElement('child-child') | |
| export class ChildChild extends LitElement { | |
| static styles = css`p { color: blue }`; | |
| connectedCallback(){ | |
| super.connectedCallback(); | |
| console.log("connectedCallback ChildChild"); | |
| } | |
| render() { | |
| return html`<child-component></child-component>`; | |
| } | |
| } |
This file contains hidden or 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
| { | |
| "files": { | |
| "test.ts": { | |
| "position": 0 | |
| }, | |
| "index.html": { | |
| "position": 1 | |
| }, | |
| "package.json": { | |
| "position": 2, | |
| "hidden": true | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment