refactor(core): adjust directory structure:
This commit is contained in:
parent
e07d36f44e
commit
aad62b65f5
20 changed files with 381 additions and 93 deletions
11
src/core/route/util.js
Normal file
11
src/core/route/util.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
export function cleanPath (path) {
|
||||
return path.replace(/\/+/g, '/')
|
||||
}
|
||||
|
||||
export function getLocation (base) {
|
||||
let path = window.location.pathname
|
||||
if (base && path.indexOf(base) === 0) {
|
||||
path = path.slice(base.length)
|
||||
}
|
||||
return (path || '/') + window.location.search + window.location.hash
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue