-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🐛[BUG]EditableProTable中的日期选择框报错 #6785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
以下的 Issues 可能会帮助到你 / The following issues may help you
|
针对你提供的问题描述,是一个"clone.weekday() is not a function" 的报错信息。这可能是因为你在使用 EditableProTable 组件时使用了 dayjs 1.11.7 版本,导致出现兼容性问题。安装 dayjs 1.11.4 后问题得到了解决。 那么,为了避免这个问题的出现,建议在使用 EditableProTable 组件时,使用兼容性更好的 dayjs 版本,比如 dayjs 1.10.x 版本或者更高版本(建议使用最新版本)。 同时,在处理日期时,建议使用 dayjs 所提供的方法,如 dayjs().format() 或 dayjs().diff() 等,具体使用方法可以参考 dayjs 的文档:https://day.js.org/docs/en/。 另外,如果你遇到了其他的问题,也建议提供更详细的问题描述和可复现的代码,这样才能更快地帮助你解决问题。 |
dayjs 做了api的break升级了吗? 看起来好像没有欸 |
我怎么感觉我这个默认调用的是moment.js |
对于你遇到的问题,也有可能是因为你默认调用的是 moment.js,而不是使用 dayjs,所以你需要在你的代码中对日期进行正确的处理。 对于日期处理,moment.js 和 dayjs 有一些区别。具体来说,dayjs 的 API 类似于 moment.js,但是比 moment.js 更轻量级和更快,支持链式调用,可以轻松地转换日期格式,并且具有各种获取日期差异、格式化、解析、有效性检查等功能。 如果你想切换到 dayjs,请先卸载 moment.js,然后使用 npm 安装 dayjs:
然后,在你的项目代码中使用: import dayjs from 'dayjs' 来代替原来的 moment.js,这样就可以使用 dayjs 的所有功能了。 更多关于如何使用 dayjs 的例子和方法,请参考 dayjs 的官方文档:https://day.js.org/docs/en/。同时,还有 dayjs 文档中提供的一些 dayjs 的工具和插件,可以根据需要选择不同的工具和插件来进行开发。 |
两个无缝转化的,注意下依赖版本即可 不要两份dayjs 和两份 moment |
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
clone.weekday() is not a function
📷 复现步骤
我的项目是dayjs1.11.7,会报错;
安装dayjs1.11.4后恢复正常。
🏞 期望结果
💻 复现代码
© 版本信息
🚑 其他信息
The text was updated successfully, but these errors were encountered: