VueRouter多层嵌套路由
发布于 3 年前 作者 ab8512 669 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

大家好,我在使用VueRouter的时候遇到了一些问题,恳请大家帮忙协助下小弟
问题描述:
我还处在摸索Vue的路上,我想实现的功能是:
this.$router.push(’/user/center/password/forget’) 的时候跳转到 PasswordForgetPage 这个页面
this.$router.push(’/user/center/password’) 的时候跳转到 PasswordPage 这个页面
我希望的是 [PasswordPage] 界面跟 [PasswordForgetPage] 的内容是分开的,但是我在使用的过程中发现,如果 PasswordPage 如果有内容,那么 this.$router.push(’/user/center/password/forget’) 的时候, PasswordForgetPage 页面也会出现
PasswordPage 的内容
问题截图:

PasswordPage页面 :

PasswordForgetPage页面 :

代码:

vur-router 相关的引用组件部分代码

UserPasswordPage 页面代码

UserPasswordForgetPage 页面代码

回到顶部