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

The ConfigProvider component cannot dynamically change the language #4225

Closed
1 task done
jiangmaniu opened this issue Jun 18, 2021 · 2 comments
Closed
1 task done
Labels

Comments

@jiangmaniu
Copy link

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

看了一下组件源码,发现在监听 props 时,直接将新的 props 值与 configProvider 进行了一次合并,但这次新的 props 对象的值不只有传入的 locale 还有其他的属性,但这些属性的值都是 undefined,这样会导致合并时将 configProvider 一次是生成的 getPrefixCls 属性方法替换成 undefined,在之后的组件使用 configProvider.getPrefixCls 就会报错。

Version

vue: v3.1.1 ant-design-vue: v2.2.0-bate.3

Reproduction link

github
codesandbox

Steps to reproduce

  1. 访问 codesandbox 链接
  2. 在 demo 的页面中,直接点击切换语言时会报错

What is expected?

正常改变 locale

What is actually happening?

组件内部报错
image


@github-actions github-actions bot changed the title ConfigProvider 组件无法动态改变语言 The ConfigProvider component cannot dynamically change the language Jun 18, 2021
@jiangmaniu
Copy link
Author

或许跟 vue: v3.1.1breaking-changes 有关,但我不确定,因为我将 vue: v3.1.1 回退到 vue: v3.0.11 时,貌似还是会有这个问题。

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants