Starter · code-edit

watch cleanup 與 onMounted

先看見缺口,再完成一個小修改。

本階段驗收

頁面不會替你修改檔案;請在實作檔完成後重新整理確認。

目前要處理

term 空白,DOM ref 尚未 mounted。

預期看到

activeId=watch-name-input、cleanupCount=1、staleRuns=0、finalTerm=ab。

watch(term,(value,_,onCleanup)=>{const id=setTimeout(...);onCleanup(()=>clearTimeout(id))}); onMounted(()=>input.value.focus())。

檔案清單

只在本階段資料夾內操作,避免改到其他章節。

證據:activeId=watch-name-input、cleanupCount=1、staleRuns=0、finalTerm=ab

前往 Checkpoint →