Skip to content

DirectoryTree: [Vue warn]: Slot "default" invoked outside of the render function #5170

@think-gem

Description

@think-gem
  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.8

Environment

win、chrome92、vue3

Reproduction link

https://gitee.com/thinkgem/jeesite-vue/blob/master/src/components/Tree/src/Tree.vue#L578

Steps to reproduce

The tree directory warns when using TSX:

[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.
at <ADirectoryTree>
at <Tree>
......

will

const TreeComp = showIcon ? Tree.DirectoryTree : Tree;

change

const TreeComp = Tree;

after modification,no warning.

But I hope, use DirectoryTree no warning.

Old issues: #5013

What is expected?

There is no warning

What is actually happening?

A warning [Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions