image-edit
Task 7: FilterBar Component
Create the filter and status bar component. **Do:** - Create `src/lib/FilterBar.svelte` - Props: `todos: Todo[]`, `filter: Filter`, `onFilterChange: (f: Filter) => void` - Show count: "X items left" (incomplete count) - Three filter buttons: All, Active, Completed - Active filter is visually highlighted - "Clear completed" button (hidden when no completed todos) - Add component tests **Verify:** - Tests pass - Component renders count, filters, clear button ---
← 返回教程列表
AI8899 · 内容仅供学习参考