【发布时间】:2021-12-03 23:24:57
【问题描述】:
我正在尝试使用 Nuxt/i18n 本地化 DateTime,
但它不起作用!
nuxt config 中 Nuxt/i18n 的这个 i Config
{
seo: true,
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.js',
dir: 'ltr',
name: 'English',
id: 2,
}
],
lazy: true,
langDir: 'locales/',
defaultLocale: 'en',
strategy: 'prefix_except_default',
dateTimeFormats: {
'en-US': {
short: {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'short',
},
long: {
year: 'numeric',
month: 'short',
day: 'numeric',
weekday: 'short',
hour: 'numeric',
minute: 'numeric',
},
},
},
},
我该如何解决这个问题?
我该如何解决这个问题?
我该如何解决这个问题?
【问题讨论】:
-
@JasonLandbridge ,因为我的代码很长而且 Stack 不允许我发帖,我不得不在更长的文本内容中添加“我该如何解决这个问题”
-
@JasonLandbridge ,我使用 ```
{{ $d(new Date(), 'short') }}
``` 进行本地化,但它不起作用
标签: vue.js internationalization nuxt-i18n