finished pruning for lit-only demo

This commit is contained in:
authentik Default Admin 2026-03-04 14:18:44 -08:00
parent 648412dd6d
commit 3736d7278b
10 changed files with 217 additions and 281 deletions

View file

@ -1,11 +1,11 @@
// components/page-home.js
import { LitElement, html, css } from 'lit'
import { store } from '../store/index.js'
import { StoreController } from '../controllers/store.js'
class PageHome extends LitElement {
#user = new StoreController(this, store, s => s.user)
#items = new StoreController(this, store, s => s.items)
static properties = {
user: { type: Object },
items: { type: Array }
}
static styles = css`
:host { display: block; padding: 2rem 1.5rem; }
@ -25,8 +25,8 @@ class PageHome extends LitElement {
`
render() {
const name = this.#user.value?.name ?? 'there'
const count = this.#items.value.length
const name = this.user?.name ?? 'there'
const count = this.items?.length ?? 0
return html`
<h1>Hey, ${name}</h1>
@ -41,4 +41,4 @@ class PageHome extends LitElement {
}
}
customElements.define('page-home', PageHome)
customElements.define('page-home', PageHome)