NuxtJS i18n \[vue-router\]名称为about_us___en的路由不存在

vue.js Vue.js

卡卡西猪猪

2020-03-24

我正在使用nuxtjs 2.10.x和i18n模块。Nu自定义中间件或类似的东西。路由工作正常。

我的nuxt.config.js模块/ i18n部分:

    ...
modules: [
'@nuxtjs/axios',
'@nuxtjs/pwa',
'@nuxtjs/auth',
'@nuxtjs/dotenv',
'nuxt-fontawesome',
[
  'nuxt-i18n',
  {
    locales: [
      {
        code: 'en',
        iso: 'en-US',
        file: 'en.json',
        name: 'English'
      },
      {
        code: 'zh',
        iso: 'zh-CN',
        file: 'zh.json',
        name: '简体中文'
      }
    ],
    lazy: true,
    langDir: 'locales/',
    defaultLocale: 'en',
    strategy: 'prefix_except_default',
    differentDomains: false,
    vueI18n: {
      fallbackLocale: 'en'
    },
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: 'lang'
    }
  }
    ]
  ],
...

页面文件夹结构:

  'pages/'
    |--'contact_us.vue'
    |--'_lang/'
         |--'contact_us.vue'

但是我收到了这个疯狂的警告:[vue-router] Route with name 'contact_us___en' does not exist实际上,nuxt对所有页面都给出了类似的警告。而且没有任何线索为什么会这样。可能是什么问题?

第3393篇《NuxtJS i18n \[vue-router\]名称为about_us___en的路由不存在》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android