vue刷新重定向某个页面(解决Uncaught (in prom
2019-12-10 本文已影响0人
一包
- 在App.vue中加入
created() {
if (this.$router.path !== "/home" || this.$router.path !== "/") {
this.$router.replace("/");
}
}
-
但是不知道为啥会有一个报错,但不影响项目运行
bug是因为vue有bug 解决:
npm i vue-router@3.0 -S