vite-plugin-vue-layouts
vite-plugin-vue-layouts copied to clipboard
Additional route is being generated for layout file
Using vitesse with vite-plugin-pages: "^0.18.2" vite-plugin-md: "0.11.4" vite-plugin-vue-layouts: 0.5.0
When accessing the route inside a markdown file in an index route case (that has children in a folder with the same name), I get a list of two possible matches for said route. On of the matches is the layout file being used.
[
{
"path": "/test",
"meta": {},
"props": {
"default": false
},
"children": [
{
"path": "",
"children": [
{
"name": "test-test1",
"path": "test1",
"props": true
},
{
"name": "test-test2",
"path": "test2",
"props": true
}
],
"props": true
}
],
"instances": {
"default": {}
},
"leaveGuards": {
"Set(0)": []
},
"updateGuards": {
"Set(0)": []
},
"enterCallbacks": {},
"components": {
"default": {
"__hmrId": "39336072",
"__file": "E:/docs/src/layouts/default.vue"
}
}
},
{
"path": "/test",
"meta": {},
"props": {
"default": true
},
"children": [
{
"name": "test-test1",
"path": "test1",
"props": true
},
{
"name": "test-test2",
"path": "test2",
"props": true
}
],
"instances": {
"default": {
"frontmatter": {
"meta": []
}
}
},
"leaveGuards": {
"Set(0)": []
},
"updateGuards": {
"Set(0)": []
},
"enterCallbacks": {},
"components": {
"default": {
"__hmrId": "2ad13f07",
"__file": "E:/docs/src/pages/test.md"
}
}
}
]
ref: https://github.com/hannoeru/vite-plugin-pages/issues/113
Can you share or link to the repo please? That would help us figure which plugin the bug is in :)
It's happening here on the "feature/nu-docs" branch in the "docs" sub folder: https://github.com/acemod/ACE3/tree/feature/nu-docs/docs
When starting open the "/news" or "/test" page. It includes a vue component that displays the matched routes.
This is unavoidable and is a function of how vue generates its routes. Next version will have a custom getRoutes to filter out the layout routes.