[英]Can I access nuxt context in nuxt.config.js?
我正在使用nuxt-i18n和@nuxtjs/auth ,我想配置auth.redirect
選項來支持 i18n,如下所示:
// nuxt.config.js
export default {
modules: [
'@nuxtjs/auth',
'nuxt-i18n',
// ...
],
auth: {
redirect: {
home: localePath('/dashboard'),
// ...
},
},
// ...
};
通常情況下,就像this.$store
,我可以訪問localePath
所提供的功能nuxt,國際化,通過應用實例或context
像this.$localePath
或app.localePath
。 但是如何在nuxt.config.js
文件中使用它呢?
對於具有 i18n 重定向支持問題的 @nuxt/auth 模塊,我找到了一種解決方法: https : //github.com/nuxt-community/auth-module/issues/1116#issuecomment-824814739 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.