Skip to content

Commit 52462d8

Browse files
committed
fix: code review、update changelog
1 parent ed67182 commit 52462d8

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

docs/更新日志.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ abbrlink: 179nqpxt
66

77
`create-react-doc` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。
88

9+
### 1.6.1
10+
11+
`2021-12-24`
12+
13+
- **Fix**
14+
15+
- 🐞 修复访问多层级子菜单目录对应的路由时,对应菜单未被展开的问题。[issue](https://github.com/MuYunyun/create-react-doc/issues/222)
16+
917
### 1.6.0
1018

1119
`2021-10-30`

packages/crd-seed/layout/utils.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/**
22
* get keys of open sub menu from pathname
33
* {
4-
* pathname: /BasicSkill/basis/DOM,
4+
* pathname: pathname of location,
5+
* when pathname is /9f41fc98, the result is ['/docs/主题'].
6+
* when pathname is /测试/测试路由, the result is ['/docs/测试']
57
* menuOpenKeys: means extra show open keys in config.yml
68
* }
7-
* output: ["/BasicSkill", "/BasicSkill/basis"]
89
*/
910
function getOpenSubMenuKeys({
1011
pathname,
@@ -18,19 +19,6 @@ function getOpenSubMenuKeys({
1819
result
1920
)
2021

21-
/**
22-
* logic for not abbrLink
23-
* there is no pick item if the length of pathnameSplit is less than or equal to 2.
24-
* eg: /README => ["", "README"]
25-
*/
26-
// const pathnameSplit = pathname.split('/')
27-
// if (pathnameSplit.length <= 2) return result
28-
// let recordValue = ''
29-
// for (let i = 1; i < pathnameSplit.length - 1; i++) {
30-
// recordValue += `/${pathnameSplit[i]}`
31-
// result.push(recordValue)
32-
// }
33-
3422
/** default open menu from config.yml */
3523
if (menuOpenKeys) {
3624
result.push(...menuOpenKeys.split(','))

0 commit comments

Comments
 (0)