Skip to content

Carousel will trigger onMounted multiple times if more than one components #5597

@ldsenow

Description

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

Version

3.2.3

Environment

windows 10, vue 3.x

Reproduction link

https://github.com/ldsenow/ant-carousel-issue

Steps to reproduce

Launch the vue project from the repo, and check the console logs.

What is expected?

Should mount once per component

What is actually happening?

Mount multiple times


I found this issue due to i have some highchart components within the carousel. The display is pefect, however, when i navigate to another page. An error is thrown which is about highchart tries to destroy something and the instance is already destroyed. I finally find out it is causing by the carousel control somehow trigger the OnBeforeUnmount event multiple times. I guess the root cause is the mount event is triggered more than once in the early beginning. I am not quite sure how to avoid or make a work around it.

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