This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lit-it-up [2026/04/04 11:19] – admin | lit-it-up [2026/04/04 12:05] (current) – admin | ||
|---|---|---|---|
| Line 19: | Line 19: | ||
| WebComponents allow you to define/ | WebComponents allow you to define/ | ||
| + | |||
| + | **For example:** | ||
| <code html> | <code html> | ||
| < | < | ||
| + | </ | ||
| + | |||
| + | ====== WebComponent example ====== | ||
| + | |||
| + | <code JavaScript> | ||
| + | import {LitElement, | ||
| + | |||
| + | export class Typo3Surfcamp extends LitElement { | ||
| + | static properties = { | ||
| + | year: {type: Number, attribute: ' | ||
| + | }; | ||
| + | |||
| + | constructor() { | ||
| + | super(); | ||
| + | this.year = 0; | ||
| + | } | ||
| + | |||
| + | render() { | ||
| + | return html`< | ||
| + | } | ||
| + | } | ||
| + | |||
| + | customElements.define(' | ||
| + | </ | ||
| + | |||
| + | ====== Load the WebComponent ====== | ||
| + | |||
| + | |||
| + | Load a single component: | ||
| + | |||
| + | <code php> | ||
| + | $this-> | ||
| + | </ | ||
| + | |||
| + | Load multiple components with a single entry point: | ||
| + | <code php> | ||
| + | $this-> | ||
| </ | </ | ||