[Vuejs]-How to create an exception to hide a language path in a url?

0👍

Easy, just check for lang === 'en' in your map function.

module.exports = [].concat.apply([],
    langs.map(lang =>
        pages.map(page => lang === 'en' ? `/${page}` : `/${lang}/${page}`)))

Just be careful as read in comments, if you use to read url params for defining langage or if your url scheme needs to be '/something/otherthing'.

Leave a comment