feat: add config and page
This commit is contained in:
7
src/utils/path-key.ts
Normal file
7
src/utils/path-key.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const getPathKey = () => {
|
||||
// 从localtion.href的路径中,/a/b 中 a为path,b为key
|
||||
const pathname = location.pathname;
|
||||
const paths = pathname.split('/');
|
||||
const [path, key] = paths.slice(1);
|
||||
return { path, key, id: path + '---' + key, prefix: `/${path}/${key}` };
|
||||
};
|
||||
Reference in New Issue
Block a user