readme下拉
This commit is contained in:
parent
ebf75ed433
commit
3453aa31eb
|
@ -10,6 +10,11 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
|||
|
||||
useEffect(()=>{
|
||||
if(readme && readme.content){
|
||||
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;
|
||||
|
@ -18,9 +23,7 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
|||
return { href:`${path}${href}`,text:el.textContent , level:level }
|
||||
});
|
||||
setMenuList(items);
|
||||
setContent(readme.content);
|
||||
}
|
||||
},[readme])
|
||||
},[content])
|
||||
|
||||
function menu(){
|
||||
if(menuList && menuList.length > 0){
|
||||
|
|
Loading…
Reference in New Issue