1

nuxt.config.js

{
  mode: "universal",
  // target: 'static',
  ssr: true,
  router:{
    mode: 'hash',
    middleware: ['i18n']
  },
  plugins: [
    '~/plugins/i18n.js'
  ]
}

在此处输入图像描述

4

1 回答 1

0

你可能没有nuxt/i18n正确安装:https ://i18n.nuxtjs.org/setup

从 then开始yarn add nuxt-i18n,将其添加到模块中

nuxt.config.js

{
  modules: [
    'nuxt-i18n',
  ],
}

这里实际上并不需要插件,使用专门用于此目的的 Nuxt 模块会更容易。
此外,我们看不到您插件的内容或其余代码,因此我在这里推荐。

于 2021-07-25T13:20:40.377 回答