How to handle Custom Routes dynamically in Nuxt3 at nuxt.config.ts?
Hari111142 opened this issue · 0 comments
Hari111142 commented
Describe the feature
Hi Team,
I can able to route statically using this custom routes but I need to route dynamically using the path that I get from the API.
Static Custom route from nuxt.config.ts
hooks: {
'pages:extend' (pages) {
pages.push({
name: 'Article',
path: '/sample/content/article',
file: resolve(__dirname, 'pages/article')
})
console.log(pages);
}
},
API Sample code:
{
"pageProperties":{
"path":"/sample/content/article",
"templateName":"article",
"title":"Sample Title",
"type":"content/components/page/article"
},
}
Thanks in Advance
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
Final checks
- Read the contribution guide.
- Check existing discussions and issues.