search

Home  >  Q&A  >  body text

javascript - Vue sub-routing does not take effect.

{

            path: '/home',
            component: home,
            children: [
                {
                    path: '/home/withdraw',
                    component: withdraw,
                }
            ]
        },
http://192.168.2.144:8080/#/home/withdraw/

Why is it obviously matched, but still the home component? I saw other people writing the same thing, but mine doesn't match.

淡淡烟草味淡淡烟草味2780 days ago647

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-06-26 10:52:35

    The path of the child route does not need to write the parent's path, and does not need to start with /. In addition, router-view needs to be set in the parent component! The above are three pitfalls!

    reply
    0
  • 漂亮男人

    漂亮男人2017-06-26 10:52:35

    After reading your reply above, I think you can put /home/withdraw on the same level as /home. Although it looks like a sub-route, it is actually a parallel route.

    reply
    0
  • Cancelreply