docs/example/assets/js/components/TodoList.js
1 2 3 4 5 6 7 8 9 10 |
import { h3, h } from "../h3.js"; import Todo from "./Todo.js"; export default function TodoList() { const { page, pagesize } = h3.state; const filteredTodos = h3.state.filteredTodos; const start = (page - 1) * pagesize; const end = Math.min(start + pagesize, filteredTodos.length); return h("div.todo-list", filteredTodos.slice(start, end).map(Todo)); } |