fix resetRouter

This commit is contained in:
vue-admin-beautiful.com 2021-07-01 13:51:43 +08:00
parent 2f8ff389d2
commit 9e4b4cfb87
3 changed files with 2 additions and 19 deletions

View File

@ -1,8 +1,5 @@
<div align="center"><img width="200" src="https://gitee.com/chu1204505056/image/raw/master/logo/vab.svg"/> <div align="center"><img width="200" src="https://gitee.com/chu1204505056/image/raw/master/logo/vab.svg"/>
<h1> vue-admin-beautiful-proelement-ui </h1> <h1> vue-admin-beautiful-proelement-ui </h1>
<p>程序无国界但程序员有国界中国国家尊严不容挑衅如果您在特殊时期继续购买HM、耐克、阿迪达斯等品牌那么您将无权继续使用Vab</p>
<p>Programs have no borders, but programmers have borders. China's national dignity can not be challenged. If you continue to buy HM, Nike, Adidas and other brands in a special period, you will not have the right to continue to use Vab
</p>
</div> </div>
[![Website](<https://img.shields.io/badge/ good luck - vue admin beautiful -blue?style=flat-square>)](https://vue-admin-beautiful.com) [![Website](<https://img.shields.io/badge/ good luck - vue admin beautiful -blue?style=flat-square>)](https://vue-admin-beautiful.com)

View File

@ -41,7 +41,7 @@
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"core-js": "^3.15.1", "core-js": "^3.15.2",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"echarts": "^5.1.2", "echarts": "^5.1.2",
"element-ui": "^2.15.3", "element-ui": "^2.15.3",

View File

@ -371,23 +371,9 @@ const router = new VueRouter({
}), }),
routes: constantRoutes, routes: constantRoutes,
}) })
//
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject)
return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch((err) => err)
}
export function resetRouter() { export function resetRouter() {
router.matcher = new VueRouter({ location.reload()
base: publicPath,
mode: routerMode,
scrollBehavior: () => ({
y: 0,
}),
routes: constantRoutes,
}).matcher
} }
export default router export default router