feat: el-ui — activation-based frontend framework, spreading activation reactivity, graph state

This commit is contained in:
Will Anderson
2026-04-27 19:15:53 -05:00
commit 3bf3c02854
25 changed files with 4642 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
component TodoItem {
props {
text: String
done: Bool = false
}
state {
completed: Bool = false
}
template {
<li class={completed ? "item done" : "item"}>
<input type="checkbox" on:change={() => completed = !completed} />
<span>{text}</span>
</li>
}
}
component TodoApp {
state {
newItem: String = ""
items: String = ""
}
fn addItem() -> Void {
if newItem != "" {
items = items + newItem + ";"
newItem = ""
}
}
template {
<div class="todo-app">
<h1>Todos</h1>
<div class="input-row">
<input
type="text"
value={newItem}
on:input={(e) => newItem = e.target.value}
placeholder="Add a todo..."
/>
<button on:click={() => addItem()}>Add</button>
</div>
</div>
}
}
component App {
template {
<div class="app">
<TodoApp />
</div>
}
}