关于antd组件 datePicker和moment出现英文的坑

简介

使用antd3 和 antd4 的datepicker时, 会出现其他区域中文, 月份和星期为英文的情况。官网的配置都试过了。

在这里插入图片描述

解决方法(仅限antd4, antd3 moment版本未知)

  1. 安装特定版本moment : yarn add [email protected]
  2. 覆盖node_modules/moment - > node_modules/antd/node_modules/moment
    在这里插入图片描述

解决

在这里插入图片描述

猜想

  1. 可能是antd在安装时会拷贝(or 软链接)一份moment到它的子目录; 或者直接装了个最新的。 这样的话, 你单纯卸载外层的moment对它毫无影响, 或者你保证安装顺序如下:

おすすめ

転載: blog.csdn.net/chenfengshf/article/details/119931065