Solution 要做什麼
對照完整答案、責任邊界與原因。
本主題檔案:files/index.html
定位:先記錄 state sequence,再分別核對由 state 推導的 DOM 屬性。
Solution · code-edit
對照完整答案、責任邊界與原因。
對照完整答案、責任邊界與原因。
本主題檔案:files/index.html
定位:先記錄 state sequence,再分別核對由 state 推導的 DOM 屬性。
頁面不會替你修改檔案;請在實作檔完成後重新整理確認。
state=idle、按鈕可用、name 空白。
sequence=idle>error>loading>success>idle、busyDuring=true、disabledDuring=true、errorFocus=async-name-input、finalState=idle。
state='loading'; aria-busy=true; button.disabled=true;錯誤 nameInput.focus();finally state='idle'。只在本階段資料夾內操作,避免改到其他章節。
index.htmlstyle.cssmain.js證據:sequence、busyDuring/disabledDuring、errorFocus、finalState 全部符合
回到主題說明