File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1+ <!--
2+ title: 自定义主题
3+ abbrlink: 9f41fc98
4+ date: 2019-05-12 13:23:44
5+ -->
6+
17## 使用自定义主题
28
39切换主题非常简单, 只需要将根目录文件 ` config.yml ` 中的 ` theme ` 更改为您想使用的主题即可。
Original file line number Diff line number Diff line change 1+ <!--
2+ title: 默认主题
3+ abbrlink: f55182c5
4+ date: 2019-05-12 13:23:44
5+ -->
6+
17## 默认主题
28
39create-react-doc 的默认主题为 [ crd-seed] ( https://github.com/MuYunyun/create-react-doc/tree/main/packages/crd-seed ) 。该主题有以下特性:
Original file line number Diff line number Diff line change @@ -16,9 +16,6 @@ function MenuItem({
1616 }
1717
1818 const renderMenuItem = ( ) => {
19- if ( selectedKey === '/290a4219' ) {
20- debugger
21- }
2219 return (
2320 < li
2421 className = { cx ( styles [ 'menu-item' ] , styles [ `menu-${ theme } ` ] , {
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ function BasicLayout({
4343
4444 useEffect ( ( ) => {
4545 const newPathName = location . pathname
46- setSelectedKey ( `${ newPathName } .md` )
46+ // setSelectedKey(`${newPathName}.md`)
47+ setSelectedKey ( newPathName )
4748 } , location )
4849
4950 const scrollToTop = ( ) => {
@@ -59,7 +60,6 @@ function BasicLayout({
5960 const { mdconf, routePath } = item || { }
6061 const { abbrlink } = mdconf || { }
6162 const path = abbrlink ? `/${ abbrlink } ` : routePath
62- console . log ( 'item123' , item )
6363 // item.path carrys .md here.
6464 return item . children && item . children . length > 0 ? (
6565 < SubMenu key = { index } keyValue = { item . path } title = { item . name } icon = { < Icon type = "folder" size = { 16 } /> } >
You can’t perform that action at this time.
0 commit comments