Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/uni-helper/galanga
Browse files Browse the repository at this point in the history
  • Loading branch information
censujiang committed Jun 5, 2023
2 parents d35840f + cac78b1 commit 495820c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export { formatNumber } from 'galanga';
export { afterTime } from 'galanga';
//导出自己的子模块
export { localCookie } from './cookie';
export { url } from './url';
export { url, getPreURL } from './url';
export { checkDeviceType, clipboard } from './device';
export { notificationPermission, clipboardPermission, locationPermission } from './permission';
6 changes: 6 additions & 0 deletions esm/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ export const url = {
currentRoute.$page.options[key] = value;
}
};
//获取上一页的url
export function getPreURL() {
const uniRouter = getCurrentPages();
const prevRoute = uniRouter[uniRouter.length - 2];
return '/' + prevRoute.route;
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export { afterTime } from 'galanga';

//导出自己的子模块
export { localCookie } from './cookie';
export { url } from './url';
export { url, getPreURL } from './url';
export { checkDeviceType, clipboard } from './device';
export { notificationPermission, clipboardPermission, locationPermission } from './permission';
7 changes: 7 additions & 0 deletions src/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ export const url = {
const currentRoute = uniRouter[uniRouter.length - 1];
currentRoute.$page.options[key] = value;
}
}

//获取上一页的url
export function getPreURL() {
const uniRouter = getCurrentPages();
const prevRoute = uniRouter[uniRouter.length - 2];
return '/' + prevRoute.route;
}
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export { filterUniqueByProperty } from 'galanga';
export { formatNumber } from 'galanga';
export { afterTime } from 'galanga';
export { localCookie } from './cookie';
export { url } from './url';
export { url, getPreURL } from './url';
export { checkDeviceType, clipboard } from './device';
export { notificationPermission, clipboardPermission, locationPermission } from './permission';
1 change: 1 addition & 0 deletions types/url.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export declare const url: {
setPath: (value: string) => void;
setQuery: (key: string, value: string) => void;
};
export declare function getPreURL(): string;

0 comments on commit 495820c

Please sign in to comment.