Skip to content

Tree组件Props draggable 类型警告错误 #8140

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
1 task
asuradaSong opened this issue Apr 23, 2025 · 3 comments
Open
1 task

Tree组件Props draggable 类型警告错误 #8140

asuradaSong opened this issue Apr 23, 2025 · 3 comments

Comments

@asuradaSong
Copy link

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

Version

4.2.6

Environment

vue 3.4.23

Reproduction link

Edit on CodeSandbox

Steps to reproduce

<Tree draggable={{ icon: } />

What is expected?

消除props类型警告

What is actually happening?

Tree组件draggable 需要传递一个对象时出现 [Vue warn]: Invalid prop: type check failed for prop "draggable". Expected Function | Boolean, got Object

@selicens
Copy link
Member

应该传递Boolean类型的props

@asuradaSong
Copy link
Author

组件写的是Boolean 类型但是可以传递对象 只不过会报props不支持对象类型

@asuradaSong
Copy link
Author

Image

[Vue warn]: Invalid prop: type check failed for prop "draggable". Expected Function | Boolean, got Object
at <Tree itemHeight=24 onDrop=fn height=280 ... >
at <ATree itemHeight=24 draggable=
{icon: {…}}
icon
:
{__v_isVNode: true, __v_skip: true, props: null, key: null, type: ƒ, …}
[[Prototype]]
:
Object

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants