Skip to content

The validation of props.onUpdate:value of components such as input only accepts functions. #5410

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

Closed
1 task done
merfais opened this issue Mar 27, 2022 · 5 comments
Closed
1 task done

Comments

@merfais
Copy link

merfais commented Mar 27, 2022

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

Version

undefined

Environment

ant-design-vue": "^3.0.0-beta.3 ""vue": "^3.2.31"

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. 新建子组件input-demo,里面只使用a-input,组件绑定 @update:value接口, <a-input @update:value="onInputUpdate" />
  2. 新建组件,使用上面定义的子组件,也绑定@update:value接口给 <InputDemo @update:value="onParentUpdate" />

What is expected?

console中不报错,vue3本身支持了attrs透传和绑定,也支持了事件的合并,因此校验时function是不妥的,也可能是Array

What is actually happening?

console中有校验报错
[Vue warn]: Invalid prop: type check failed for prop "onUpdate:value". Expected Function, got Array
at <AInput value="123" onUpdate:value= (2) [ƒ, ƒ] >
at <AntInput onUpdate:value=fn >
at

@github-actions github-actions bot changed the title input等组件的props.onUpdate:value的校验只接受function不妥 The validation of props.onUpdate:value of components such as input only accepts functions. Mar 27, 2022
@tangjinzhou
Copy link
Member

添加 inheritAttrs: false, 取消继承合并

@merfais
Copy link
Author

merfais commented Mar 28, 2022

添加 inheritAttrs: false, 取消继承合并

就是要继承,你却让取消继承,解决问题的方式是消灭问题吗?!!

@github-actions
Copy link

Hello @merfais. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch, fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @merfais,我们完全同意你的提议/反馈,欢迎直接在此仓库创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支,务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

@KaygNas
Copy link
Contributor

KaygNas commented Dec 2, 2022

添加 inheritAttrs: false, 取消继承合并

就是要继承,你却让取消继承,解决问题的方式是消灭问题吗?!!

你的情况应该和我遇到的是类似的 #5414 (comment)

Copy link

github-actions bot commented Dec 3, 2023

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 Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants