Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

vue-router嵌套路由的history问题?

在设置路由时,遇到个问题。从页面 home->user->query,这个query有个子路由用来显示查询出来的结果。在query页面有个按钮,当按下后会请求数据,返回后在 query/list 子页面中显示。这一过程是没问题的。点返回,回到query页面,再次点查询按钮时 地址栏是 query/list 正常的,这个时候再次返回,问题出现了,地址栏变成 /user 而不是 /query

{
    path: '/user',
    name: 'user',
    component: User,
    meta:{
        requireAuth: true
    },
    children: [
        {
          path: 'list',
          component: list
        },
    ]
},

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...