I18n-module: [Feature Request] Use Folder Name Without Index in Custom Routes

Created on 21 Mar 2018  ยท  3Comments  ยท  Source: nuxt-community/i18n-module

Problem to Solve

If I use folder-based routing, i have to write

   'register/index': {
      id: '/masuk',
      en: '/login'
    }

Proposed Solution

Why not just write the name of folder without index as same as for file-based routing,

   'register': {
      id: '/masuk',
      en: '/login'
    }

This question is available on Nuxt.js community (#c31)

Most helpful comment

I think this is already working with the right folder structure.

pages/
โ”œโ”€โ”€ register.vue
โ”œโ”€โ”€ register/
โ”‚   โ”œโ”€โ”€ index.vue
โ”‚   โ”œโ”€โ”€ foobar.vue
โ”‚   โ”œโ”€โ”€ bazfoo.vue

Use the register.vue component to always display the child:

<template>
  <nuxt-child/>
</template>

All 3 comments

I think this is already working with the right folder structure.

pages/
โ”œโ”€โ”€ register.vue
โ”œโ”€โ”€ register/
โ”‚   โ”œโ”€โ”€ index.vue
โ”‚   โ”œโ”€โ”€ foobar.vue
โ”‚   โ”œโ”€โ”€ bazfoo.vue

Use the register.vue component to always display the child:

<template>
  <nuxt-child/>
</template>

Thanks, it worked!

This question has been resolved by @manniL, see answer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanwenfu picture fanwenfu  ยท  15Comments

johnboylesingfield picture johnboylesingfield  ยท  17Comments

simplenotezy picture simplenotezy  ยท  28Comments

pi0 picture pi0  ยท  18Comments

varna picture varna  ยท  14Comments