Zum Dummi
Zum Dummi

Reputation: 233

routing dynamic or basic for Nuxt js Routing

which good for choosing to route in Next js for route only Home, Gallery and Contact us ?? should i use dynamic for it ? or just basic? any idea for path them? I still learning so, I do like get some idea, I have read some articles on google also, mostly they just home and about, :D for Nuxt js or any article to read it ?? please link it :D

is that right qw do not create Vue.use(router) on any component files in webpack of nuxt js ?

could i use this ?

router: {
  routes: [
    {
      name: 'index',
      path: '/',
      component: 'pages/index.vue'
    },
    {
      name: 'About',
      path: '/About',
      component: 'pages/about/index.vue'
    },
    {
      name: 'Contact-us',
      path: '/user/contact',
      component: 'pages/user/contact.vue'
    }
  ]
}

i do like someome to fix it if incorrect

Upvotes: 0

Views: 493

Answers (1)

niclas_4
niclas_4

Reputation: 3674

Welcome on SO, to achieve your sent example you simply need the following Structure in your Pages Folder (if you use the standard nuxt setup).

pages/
  index.vue
  about.vue
  user/
      contact.vue

But to be honest if you really googled and informed yourself or even flew over the docs you would know how the Router in Nuxt works. Here I link you the well written Docs again, I hope you will read them carefully and be able to achieve good results. https://nuxtjs.org/guide/routing/

Upvotes: 1

Related Questions