vuepress中是否可以有子路径和路径视图?

问题描述 投票:1回答:1

我正在尝试在主页中创建子级路由视图,但在vuepress中找不到实现此功能的方法。

这通常是我在Vue中的router.js中完成的方式

    routes: [
        {
            path: '/',
            name: 'home',
            component: Home,
            children: [
                {
                    path: '/work/:worktitle',
                    name: 'workpage',
                    // component: () => import(/* webpackChunkName: "about" */ './views/WorkView.vue'),

                    component: WorkView,
                    props: true
                }
            ]
        }
    ]

但是我不知道我可以在vuepress的哪里放置这样的代码。 (没有router.js)

我正在尝试完成此操作,因为我正在尝试在主页中包含链接的集合,当我单击该链接时,我希望将这些链接的页面呈​​现为模式,而无需转到新页面。但我想保留直接链接到这些模式的功能。

nested vue-router children vuepress
1个回答
0
投票

.vuepress/enhanceApp.js一起使用.vuepress/enhanceApp.js

router.addRoutes
© www.soinside.com 2019 - 2024. All rights reserved.