antd组件使用dayjs替换Moment
因为antd与Moment强耦合,官方提供了方案使用dayjs替换Moment,现有模版中已使用(方法2)替换Moment.js
但是在使用的时候会因为dayjs与组件中定义的类型不一致导致ts报错
添加如下配置可正常使用dayjs
declare module 'moment' {
import { Dayjs } from 'dayjs';
namespace moment {
type Moment = Dayjs;
}
export = moment;
export as namespace moment;
}