Skip to content
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

Bug: 表单连续两次setValues报错 #5061

Closed
mynetfan opened this issue Dec 6, 2024 · 0 comments · Fixed by #5064
Closed

Bug: 表单连续两次setValues报错 #5061

mynetfan opened this issue Dec 6, 2024 · 0 comments · Fixed by #5064
Assignees

Comments

@mynetfan
Copy link
Collaborator

mynetfan commented Dec 6, 2024

Version

Vben Admin V5

Describe the bug?

调用表单的setValues时,如果传入的值包含dayjs类型,那么从第二次开始就会报错

Reproduction

基础表单演示页面 点击多次设置表单值。
从第二次开始,生产环境下会在控制台报错,开发环境下会导致页面路由无法切换

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 2.36 GB / 15.68 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.2.5 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.0 - ~\AppData\Local\pnpm\pnpm.CMD
    bun: 1.1.38 - ~\AppData\Local\pnpm\bun.CMD
  Browsers:
    Edge: Chromium (128.0.2739.42)
    Internet Explorer: 11.0.26100.1882

Relevant log output

dayjs.js:180  Uncaught (in promise) TypeError: date4.locale is not a function
    at Object.format (dayjs.js:180:44)
    at formatValue (dateUtil.js:105:79)
    at useValueTexts.js:20:25
    at useMemo.js:7:26
    at callWithErrorHandling (runtime-core.esm-bundler.js:199:19)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:206:17)
    at baseWatchOptions.call (runtime-core.esm-bundler.js:6193:47)
    at job (reactivity.esm-bundler.js:1813:18)
    at flushPreFlushCbs (runtime-core.esm-bundler.js:356:7)
    at updateComponentPreRender (runtime-core.esm-bundler.js:5464:5)


### Validations

- [X] Read the [docs](https://doc.vben.pro/)
- [X] Ensure the code is up to date. (Some issues have been fixed in the latest version)
- [X] I have searched the [existing issues](https://github.com/vbenjs/vue-vben-admin/issues) and checked that my issue does not duplicate any existing issues.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vbenjs/vue-vben-admin/discussions) or join our [Discord Chat Server](https://discord.gg/8GuAdwDhj6).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@mynetfan mynetfan self-assigned this Dec 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant