Skip to content

Commit

Permalink
Version_0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
censujiang committed Jun 3, 2023
1 parent 2c40dd9 commit cac78b1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 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 @@ -26,3 +26,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;
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uni-helper/galanga",
"version": "0.1.8-test1",
"version": "0.1.9",
"description": "JS common function library(UNI-APP version of Galanga)",
"main": "esm/index.js",
"jsnext:main": "esm/index.js",
Expand Down Expand Up @@ -70,6 +70,6 @@
"typescript": "^5.0.4"
},
"dependencies": {
"galanga": "^0.1.8"
"galanga": "^0.1.9"
}
}
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 @@ -27,4 +27,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;
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1600,10 +1600,10 @@ function-bind@^1.1.1:
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==

galanga@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/galanga/-/galanga-0.1.8.tgz#a4668b9f3303daf1233e0a8305ce243078804bbf"
integrity sha512-miv0pAFcoS8I09wDhIM16g7jL9l5uxlyu6ksmKClTfIJpr0q/E6rhuyWguV6wGYoSVkVKRaFPuBhCnLZL6ARBw==
galanga@^0.1.9:
version "0.1.9"
resolved "https://registry.npmjs.org/galanga/-/galanga-0.1.9.tgz#10170983feb5e492f8dda2280095f4c1021a7344"
integrity sha512-OXZH80m7x1Q70sJrtv1jyDXQFlHSCk1Ws1j96WEYbuBFNRRc9zzUsq4hqz34IvRhxDnDJzd66WuDuMN/p86Eeg==

gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
Expand Down

0 comments on commit cac78b1

Please sign in to comment.