nuxt projects generate routes based on the folder directory. Now in the news section of the folder, the _ id file has been used as the news content details page. Now a new page is added, which also needs to search and classify according to the news id. After adding an underlined file, clicking on the news list will still jump to the _ id file. How to customize the route so that all routes point to
/ news/ current id?
look at the document, there is extendRoutes configuration
export default {
router: {
extendRoutes (routes, resolve) {
routes.push({
name: "custom",
path: "*",
component: resolve(__dirname, "pages/404.vue")
})
}
}
}
but what if this configuration makes both underscore _ id files point to the same route?