我正在使用nuxt-i18n和@nuxtjs/auth,并且想要配置auth.redirect
选项以支持i18n,如下所示:
// nuxt.config.js
export default {
modules: [
'@nuxtjs/auth',
'nuxt-i18n',
// ...
],
auth: {
redirect: {
home: localePath('/dashboard'),
// ...
},
},
// ...
};
通常,就像this.$store
一样,我可以通过应用实例访问nuxt-i18n提供的localePath
函数,也可以像context
或{{1 }}。但是如何在this.$localePath
文件中使用它?
答案 0 :(得分:1)
如果@nuxt/auth 模块存在 i18n 重定向支持问题,我找到了一个解决方法:https://github.com/nuxt-community/auth-module/issues/1116#issuecomment-824814739。