Skip to content

Commit

Permalink
更新版本
Browse files Browse the repository at this point in the history
  • Loading branch information
censujiang committed Jun 5, 2023
1 parent 2c40dd9 commit d35840f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 18 deletions.
3 changes: 1 addition & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"type-check": "vue-tsc --noEmit",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"postinstall": "npx simple-git-hooks"
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3080320230523001",
Expand Down
12 changes: 6 additions & 6 deletions demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2289,9 +2289,9 @@
eslint-visitor-keys "^3.3.0"

"@uni-helper/galanga@file:..":
version "0.1.6-test2"
version "0.1.8-test1"
dependencies:
galanga "^0.1.6-fix.1"
galanga "^0.2.0"

"@uni-helper/pages-json-schema@^0.2.1":
version "0.2.1"
Expand Down Expand Up @@ -4382,10 +4382,10 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3:
resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834"
integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==

galanga@^0.1.6-fix.1:
version "0.1.6-fix.1"
resolved "https://registry.yarnpkg.com/galanga/-/galanga-0.1.6-fix.1.tgz#40d4b238f2dd0cc6e083558814bc80e74d8b63e9"
integrity sha512-TcqKmkbo1NNytHk5GMQgypBPUMrwka/UEVCNObdbaVOq98ql+XZ5OOngEfqA3fXuarJStGNOVRJGVIlCrTUdXw==
galanga@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/galanga/-/galanga-0.2.0.tgz#4fc997c763fa51fff44c2ea127f36b139f661a46"
integrity sha512-oqrtCQUxNK2KsPhk3QWolBNPrfj424+ROVngi3cZFaXJyVylQiIIEVtfgPACAlM/UH0MVYA5VKlvWA5bfhi/Yg==

generic-names@^4.0.0:
version "4.0.0"
Expand Down
5 changes: 4 additions & 1 deletion esm/url.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export const url = {
getPath: () => {
getPath: (isFullPath = false) => {
const uniRouter = getCurrentPages();
const currentRoute = uniRouter[uniRouter.length - 1];
if (isFullPath) {
//return currentRoute.route;
}
return '/' + currentRoute.route;
},
getQuery: (value) => {
Expand Down
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.2.0",
"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.2.0"
}
}
8 changes: 6 additions & 2 deletions src/url.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
declare const getCurrentPages: () => any[];

export const url = {
getPath: () => {
getPath: (isFullPath =false) => {
const uniRouter = getCurrentPages();
const currentRoute = uniRouter[uniRouter.length - 1];
return '/' + currentRoute.route;
if(isFullPath) {
return currentRoute.$page.fullPath;
}else{
return '/' + currentRoute.route;
}
},
getQuery: (value: string) => {
const uniRouter = getCurrentPages();
Expand Down
2 changes: 1 addition & 1 deletion types/url.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export declare const url: {
getPath: () => string;
getPath: (isFullPath?: boolean) => string;
getQuery: (value: string) => any;
getHash: () => any;
setHash: (value?: string) => boolean;
Expand Down
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.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/galanga/-/galanga-0.2.0.tgz#4fc997c763fa51fff44c2ea127f36b139f661a46"
integrity sha512-oqrtCQUxNK2KsPhk3QWolBNPrfj424+ROVngi3cZFaXJyVylQiIIEVtfgPACAlM/UH0MVYA5VKlvWA5bfhi/Yg==

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

0 comments on commit d35840f

Please sign in to comment.