mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 优化路由重复提示的报错
This commit is contained in:
parent
6fba94594b
commit
2bd077136f
6
resources/assets/js/app.js
vendored
6
resources/assets/js/app.js
vendored
@ -82,9 +82,9 @@ router.afterEach(() => {
|
||||
Vue.prototype.goForward = function(location, isReplace) {
|
||||
if (typeof location === 'string') location = {name: location};
|
||||
if (isReplace === true) {
|
||||
app.$router.replace(location).then(() => {});
|
||||
app.$router.replace(location).then(() => {}).catch(() => {});
|
||||
} else {
|
||||
app.$router.push(location).then(() => {});
|
||||
app.$router.push(location).then(() => {}).catch(() => {});
|
||||
}
|
||||
};
|
||||
|
||||
@ -94,7 +94,7 @@ Vue.prototype.goBack = function (number) {
|
||||
if ($A.runNum(history['::count']) > 2) {
|
||||
app.$router.go(typeof number === 'number' ? number : -1);
|
||||
} else {
|
||||
app.$router.replace(typeof number === "object" ? number : {path: '/'}).then(() => {});
|
||||
app.$router.replace(typeof number === "object" ? number : {path: '/'}).then(() => {}).catch(() => {});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user