Alpine.js Reactive Todo: Add, Edit, Delete & Persist
P
Prompt
Create an interactive Todo application using Alpine.js with reactive data binding. It should allow adding new items, editing inline, marking complete, and deleting items. Include a filter (All / Active / Completed) and persist the todo list in localStorage so that data survives page refresh. Use Tailwind CSS for styling. Keep the code clean, minimal, and functional.
CODE PREVIEW
エディタを読み込み中…
AIとの対話に追加する一言
プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします
このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。
初心者なので、各行にコメントを追加して、何をしているか説明してください。
このコードをWordPressのテーマに組み込む方法も教えてください。
動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。
このTodoアプリはAlpine.jsで作られており、最小限のJavaScriptでリアクティブなデータバインディングを実現しています。機能は以下の通りです:
- 入力フォームから追加
- 編集ボタンでその場でインライン編集
- チェックボックスで完了マーク
- 個別に削除
- すべて/アクティブ/完了済みでフィルタリング
- localStorageへの永続化でリロード後もデータ保持
CDNからAlpine.jsを読み込むだけで、ビルドツールは不要です。
Prompt Overview
This todo app is built with Alpine.js and demonstrates reactive data binding with minimal JavaScript. Features include:
- Add new todos using the input form
- Inline edit by clicking the edit button
- Check off as completed
- Delete individual items
- Filter by All / Active / Completed
- Persist todos in localStorage so data survives page refreshes
No build tools needed — just Alpine.js loaded from CDN.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選