Skip to content

Vue watch not triggered when router-view not displayed #899

@yannbriancon

Description

@yannbriancon

Version

4.0.6

Reproduction link

https://codesandbox.io/s/vue-router-watch-issue-miywr

Steps to reproduce

Uncomment <router-view> in pages/index.vue, refresh and see the expected console log

It is triggered by the watch in pages/useService.js because we change the useService.pollingActivated ref value

Comment <router-view> in pages/index.vue, refresh and see no console log

What is expected?

Even when <router-view> is not displayed in index.vue, the watch in pages/useService.js should be triggered and we should see the console log

What is actually happening?

The watch in pages/useService.js is triggered only when <router-view> is displayed in index.vue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontribution welcomeThe team would welcome a contribution from the community for this issueexternalThis depends on an external dependency but is kept opened to track ithas workaroundA workaround has been found to deal with the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions