Answer the question
In order to leave comments, you need to log in
CNC, Nuxtjs how to implement?
Colleagues, welcome.
Nuxtjs
SSR
I want to implement CNC on the site.
Scheme:
1 (http://domain.ru/voronez)
2 (http://domain.ru/voronez/avtoservis)
3 (http://domain.ru/voronez/avtoservis/diagnostica)
export function createRouter() {
const router = new Router({
mode: 'history',
routes: [
{
path: '/',
component: Index
},
{
name: 'organizations_city',
path: '/:city',
component: Organizations,
props: true,
beforeEnter: (to, from, next) => {
next()
}
},
{
name: 'organizations_city_category',
path: '/:city/:category',
component: Organizations,
beforeEnter: (to, from, next) => {
next()
}
}
]
})
http://domain.ru/город/категория/услуга
Answer the question
In order to leave comments, you need to log in
Well, you have / will have some kind of database with all the cities, their ids and names. If it is possible to rewrite the server - make it so that in addition to the id it can accept the name of the city.
If not, you can make an additional api point passing the name there, and get the id.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question