const routes = [{
path: “/”,
redirect: “/index”
},
]
const router = new VueRouter({
routes,
mode: ‘history’,
//回到顶部
scrollBehavior: () => ({
y: 0
})
})
这里的必须是routes,而不是routers,如果是routers将无法显示路由中的内容
记录个人router-view输出无法渲染问题
猜你喜欢
转载自blog.csdn.net/weixin_43817724/article/details/96317207
今日推荐
周排行