diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index 563c798fb..e7e9826e3 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -10,18 +10,21 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ useEffect(()=>{ if(readme && readme.content){ - let path = history.location.pathname; - const items = $.map($("#readme").find("h1,h2,h3,h4,h5,h6"), function (el, _) { - const anchor = el.id; - const level = el.tagName.replace("H", ""); - const href = `#${anchor}`; - return { href:`${path}${href}`,text:el.textContent , level:level } - }); - setMenuList(items); setContent(readme.content); } },[readme]) + useEffect(()=>{ + let path = history.location.pathname; + const items = $.map($("#readme").find("h1,h2,h3,h4,h5,h6"), function (el, _) { + const anchor = el.id; + const level = el.tagName.replace("H", ""); + const href = `#${anchor}`; + return { href:`${path}${href}`,text:el.textContent , level:level } + }); + setMenuList(items); + },[content]) + function menu(){ if(menuList && menuList.length > 0){ let hash = history.location.hash;