【发布时间】:2020-08-29 17:31:39
【问题描述】:
我在 "strategy: 'prefix'" 模式下使用 Nuxt.js 和 nuxt-i18n。 About this strategy。
我有一个问题:
当我尝试获取应用程序的主页时,Nuxt 将我重定向到localhost:3000/en/,但我需要重定向到localhost:3000/en。最后没有这个有害的斜线!
我的nuxt.config.js文件有sn-p:
modules: [
['nuxt-i18n',
{
locales: ['en', 'es'],
defaultLocale: 'en',
strategy: 'prefix',
vueI18n: {
fallbackLocale: 'en',
messages: {
en: {
greeting: 'Hello world!'
},
en: {
greeting: '¡Hola mundo!'
}
}
}
}]
]
有什么想法吗?
【问题讨论】:
标签: vue.js nuxt.js vue-router nuxt-i18n