cloud-web-corejs 1.0.54-dev.718 → 1.0.54-dev.719
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/repeatOpen.js +6 -3
package/package.json
CHANGED
package/src/utils/repeatOpen.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import settingConfig from "
|
|
1
|
+
import settingConfig from "@/settings";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 同一菜单是否允许重复打开为独立标签页。
|
|
@@ -30,7 +30,8 @@ export function viewKey(view) {
|
|
|
30
30
|
* @returns {Object} 归一化后的 location(带唯一 _rk)
|
|
31
31
|
*/
|
|
32
32
|
export function withRepeatKey(location) {
|
|
33
|
-
const loc =
|
|
33
|
+
const loc =
|
|
34
|
+
typeof location === "string" ? { path: location } : { ...location };
|
|
34
35
|
loc.query = { ...(loc.query || {}), _rk: Date.now() };
|
|
35
36
|
return loc;
|
|
36
37
|
}
|
|
@@ -44,6 +45,8 @@ export function withRepeatKey(location) {
|
|
|
44
45
|
*/
|
|
45
46
|
export function openView(router, location, route) {
|
|
46
47
|
// 未指定 route 时,用开关本身判定(等价于「除 affix/outLink 外都可重复」)
|
|
47
|
-
const repeatable = route
|
|
48
|
+
const repeatable = route
|
|
49
|
+
? isRepeatable(route)
|
|
50
|
+
: settingConfig.repeatOpenEnabled;
|
|
48
51
|
return router.push(repeatable ? withRepeatKey(location) : location);
|
|
49
52
|
}
|