Skip to content

keep-alive 缓存了多个页面后,onMouted执行多次 #7280

@daisybaicai

Description

@daisybaicai

Vue version

3.2.45

Link to minimal reproduction

https://codesandbox.io/s/musing-tristan-jjobbr?file=/src/views/components/Page2.vue

Steps to reproduce

首次执行1次onMounted 打印,page1 但点击切换到page2, 再点击page1 会发现执行了多次onMounted

What is expected?

希望只执行当前页面的onMounted,只打印一次

What is actually happening?

执行多次onMouted

System Info

No response

Any additional comments?

image

No response

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