imatrix-ui 2.7.95 → 2.7.96
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
CHANGED
package/src/router/index.js
CHANGED
|
@@ -79,6 +79,30 @@ export const errorRouterMap = [
|
|
|
79
79
|
// 404的映射必须是最后一个
|
|
80
80
|
{ path: '*', redirect: '/404', hidden: true }
|
|
81
81
|
]
|
|
82
|
+
|
|
83
|
+
// 解决Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location问题
|
|
84
|
+
const originalPush = Router.prototype.push
|
|
85
|
+
const originReplace = Router.prototype.replace
|
|
86
|
+
|
|
87
|
+
// 第一个参数,告诉原来push方法,你往哪里跳转(传递哪些参数)
|
|
88
|
+
// 第二个参数是成功的回调
|
|
89
|
+
// 第三个参数是失败的回调
|
|
90
|
+
Router.prototype.push = function(location, resolve, reject) {
|
|
91
|
+
// 如果传了 resolve&&reject
|
|
92
|
+
if (resolve && reject) {
|
|
93
|
+
originalPush.call(this, location, resolve, reject)
|
|
94
|
+
} else {
|
|
95
|
+
originalPush.call(this, location, () => {}, () => {})
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
Router.prototype.replace = function(location, resolve, reject) {
|
|
99
|
+
if (resolve && reject) {
|
|
100
|
+
originReplace.call(this, location, resolve, reject)
|
|
101
|
+
} else {
|
|
102
|
+
originReplace.call(this, location, () => {}, () => {})
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
82
106
|
export default new Router({
|
|
83
107
|
// mode: 'history', //后端支持可开
|
|
84
108
|
scrollBehavior: () => ({ y: 0 }),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
background: rgb(255, 255, 255);
|
|
6
6
|
line-height: 72px;
|
|
7
7
|
height: 72px;
|
|
8
|
-
position:
|
|
8
|
+
position: absolute;
|
|
9
9
|
z-index: 100;
|
|
10
10
|
top: 0px;
|
|
11
11
|
left: 0px;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
background: rgb(255, 255, 255);
|
|
18
18
|
line-height: 72px;
|
|
19
19
|
height: 72px;
|
|
20
|
-
position:
|
|
20
|
+
position: absolute;
|
|
21
21
|
bottom: 0px;
|
|
22
22
|
z-index: 100;
|
|
23
23
|
left: 0px;
|