Ant-design-vue: ant design 是否会考虑选择替换为dayjs

Created on 29 Jul 2020  ·  7Comments  ·  Source: vueComponent/ant-design-vue

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

考虑到包的大小,你可以用自定义日期库替换 Moment。 , 目前的方案Moment ,俩者使用作者有何见解

What does the proposed API look like?

win10

Stale

Most helpful comment

我是 Day.js 和 antd-dayjs-webpack-plugin 的作者,如果有需要,很乐意提供支持

All 7 comments

后续会跟进 react antd 的方案 https://ant.design/docs/react/replace-moment-cn 但不会移除 moment

装个antd-dayjs-webpack-plugin就好了

我是 Day.js 和 antd-dayjs-webpack-plugin 的作者,如果有需要,很乐意提供支持

ng-zorro-antd 现在使用 date-fns 了

即使有antd-dayjs-webpack-plugin,我还是想问一下,有没有改掉mutable写法的打算?比如lastMonth1.add(0 - lastMonthDiffDay, 'days')current.add(passed, 'days')

按照现在的写法,用antd-dayjs-webpack-plugin的时候必须用antdv3这个preset,它包含有badMutable这个插件,可以把dayjs变成mutable的,以完全兼容momentjs的mutable写法。但我觉得这样的话就没有达到使用dayjs的全部目的了——bundle size是减小了,却还是要用mutable的写法、要注意小心避免这种写法在不经意的时候修改了不想修改的dayjs实例。

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Was this page helpful?
0 / 5 - 0 ratings