fix(fetch): load sidebar and navbar for parent path, fixed #100
This commit is contained in:
parent
07a2a91296
commit
f3fc596951
2 changed files with 20 additions and 14 deletions
|
|
@ -45,8 +45,12 @@ export const isAbsolutePath = cached(path => {
|
|||
return /(:|(\/{2}))/.test(path)
|
||||
})
|
||||
|
||||
export const getRoot = cached(path => {
|
||||
return /\/$/g.test(path) ? path : path.match(/(\S*\/)[^\/]+$/)[1]
|
||||
export const getParentPath = cached(path => {
|
||||
return /\/$/g.test(path)
|
||||
? path
|
||||
: (path = path.match(/(\S*\/)[^\/]+$/))
|
||||
? path[1]
|
||||
: ''
|
||||
})
|
||||
|
||||
export const cleanPath = cached(path => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue