STE*_*TEN 15 javascript vue.js nuxt.js nuxt-i18n
我正在使用nuxt-i18n和@nuxtjs/auth,我想像这样配置auth.redirect
支持 i18n的选项:
// nuxt.config.js
export default {
modules: [
'@nuxtjs/auth',
'nuxt-i18n',
// ...
],
auth: {
redirect: {
home: localePath('/dashboard'),
// ...
},
},
// ...
};
Run Code Online (Sandbox Code Playgroud)
通常情况下,就像this.$store
,我可以访问localePath
所提供的功能nuxt,国际化,通过应用实例或context
类似this.$localePath
或app.localePath
。但是如何在nuxt.config.js
文件内部使用它呢?
如果 @nuxt/auth 模块存在 i18n 重定向支持问题,我找到了解决方法:https://github.com/nuxt-community/auth-module/issues/1116#issuecomment-824814739。
归档时间: |
|
查看次数: |
712 次 |
最近记录: |