@wltech/hooks
Advanced tools
Comparing version 0.1.46 to 0.1.47
{ | ||
"name": "@wltech/hooks", | ||
"version": "0.1.46", | ||
"version": "0.1.47", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -5,3 +5,4 @@ export * from "./useCopy"; | ||
export * from "./useWxSDK"; | ||
export * from "./useWecomSDK"; | ||
export * from "./useTurnPage"; | ||
export * from "./useSentryConfig"; |
@@ -15,3 +15,3 @@ import { TTargetAttr } from "./type"; | ||
/** | ||
* 如果是移动端target要取_top,如果是_target的话很多移动端场景会点击失效 | ||
* 跳转,如果是移动端target要取_top,如果是_target的话很多移动端场景会点击失效 | ||
* @param url | ||
@@ -18,0 +18,0 @@ * @param target |
@@ -269,3 +269,3 @@ /** | ||
} | ||
} | ||
}, | ||
); | ||
@@ -328,3 +328,3 @@ }); | ||
} | ||
} | ||
}, | ||
); | ||
@@ -422,3 +422,3 @@ }); | ||
} | ||
} | ||
}, | ||
); | ||
@@ -443,3 +443,3 @@ }); | ||
} | ||
} | ||
}, | ||
); | ||
@@ -482,2 +482,23 @@ }); | ||
} | ||
//打开浏览器 | ||
openDefaultBrowser(url: string) { | ||
return new Promise(() => { | ||
wx.invoke( | ||
"openDefaultBrowser", | ||
{ | ||
/** | ||
* 在默认浏览器打开redirect_uri,并附加code参数; | ||
* 也可以直接指定要打开的url,此时不会附带上code参数。 | ||
*/ | ||
url, | ||
}, | ||
(res) => { | ||
if (res.err_msg == "openDefaultBrowser:ok") { | ||
wx.closeWindow(); | ||
window.close(); | ||
} | ||
}, | ||
); | ||
}); | ||
} | ||
// 设置过期时间 | ||
@@ -484,0 +505,0 @@ static setExpireTime(time: number) { |
Sorry, the diff of this file is not supported yet
80483
19
2583