【发布时间】:2020-08-14 09:54:03
【问题描述】:
嗨,我正在尝试基于https://kazupon.github.io/vue-i18n/guide/pluralization.html 进行复数化
imageCount== 1
? $t("message.imageMessage", 1, { imageCount})
: $t("message.imageMessage", imageCount, {
imageCount
})
imageMessage: '{imageCount} image downloaded | {imageCount} images downloaded'
问题:目前它正在显示不应该发生的消息,我实施的方式有什么问题吗?
代码沙盒:https://codesandbox.io/s/lingering-haze-z9jzt?file=/src/components/HelloWorld.vue
【问题讨论】:
-
来自您链接的文档 ~ "您的模板将需要使用
$tc()而不是$t()"。演示~codesandbox.io/s/recursing-neumann-e2gdn?file=/src/components/… -
哦,错过了这一点,谢谢