javascript - Vue sub-routing does not take effect.
淡淡烟草味
淡淡烟草味 2017-06-26 10:50:35
0
2
642
{

            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.

淡淡烟草味
淡淡烟草味

reply all(2)
淡淡烟草味

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!

漂亮男人

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template