Skip to content

Commit 8afdd07

Browse files
committed
fix(docs): avoid auto-adding wrong routes
1 parent cb9a529 commit 8afdd07

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/src/router/routes.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ function parseMenuNode (node, __path) {
1414
component: getListingComponent(
1515
node.name,
1616
node.children.map(node => {
17-
const to = prefix + (
18-
node.path !== void 0
19-
? '/' + node.path
20-
: (node.listPath !== void 0 ? '/' + node.listPath : '')
21-
)
17+
const to = node.external === true
18+
? node.path
19+
: (
20+
prefix + (
21+
node.path !== void 0
22+
? '/' + node.path
23+
: (node.listPath !== void 0 ? '/' + node.listPath : '')
24+
)
25+
)
2226

23-
if (node.listPath !== void 0) {
27+
if (node.external !== true && node.listPath !== void 0) {
2428
docsPages.push({
2529
path: to,
2630
component: getListingComponent(
@@ -45,7 +49,7 @@ function parseMenuNode (node, __path) {
4549

4650
node.children.forEach(node => parseMenuNode(node, prefix))
4751
}
48-
else {
52+
else if (node.external !== true) {
4953
docsPages.push({
5054
path: prefix,
5155
component: () => import(`pages/${prefix.substring(1)}.md`)
@@ -71,6 +75,8 @@ const routes = [
7175
component: Layout,
7276
children: docsPages
7377
},
78+
79+
// externals
7480
{
7581
path: '/layout-builder',
7682
component: () => import('layouts/LayoutBuilder.vue')

0 commit comments

Comments
 (0)