设计了一个二级路由,同级的二级路由welcome能正确显示
部分代码如下:
import Vue from "vue"
import VueRouter from "vue-router"
import Login from "../components/Login.vue"
import Home from "../components/Home.vue"
import Welcome from "../components/Welcome.vue"
import Users from "../components/user/Users.vue"
Vue.use(VueRouter);
const router = new VueRouter({
routes: [
{ path: "/", redirect: "/login" },
{ path: "/login", component: Login },
{
path: "/home",
component: Home,
redirect: "/welcome",
children: [
{ path: "/welcome", component: Welcome },
{ path: "/users", component: Users },
],
},
],
});
已经在home.vue定义了<router-view></router-view>
可是点击users页面对应按钮的时候还是会跳转到空白页面,然后在空白页面点击刷新才会显示,这是什么问题?
刷新才会显示那应该是重定向问题,可以检查下