Skip to content

Root component not updating in the inspector when it's not the first app on the page #1500

New issue

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

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

Already on GitHub? Sign in to your account

Closed
LogicAndTrick opened this issue Jul 2, 2021 · 1 comment
Labels

Comments

@LogicAndTrick
Copy link

Version

6.0.0-beta.15

Browser and OS info

Chrome 91 / Firefox 89 / Windows 10

Steps to reproduce

  1. Save the HTML below and open in a browser
  2. Open the dev tools and select "second-app" from the app list
  3. Select the root component and note that the value in the component is 1
  4. Click the button in the second app to increase the value
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Test</title>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.1.3/vue.global.min.js"></script>
    </head>
    <body>
        <div id="app1">First app <div>{{value}}</div><button type="button" v-on:click="value++">Click me</button></div>
        <div id="app2">Second app <div>{{value}}</div><button type="button" v-on:click="value++">Click me</button></div>
        <script>
            const app = {
                data() { return {value: 1}; }
            };
            Vue.createApp({ name: 'first-app', ...app }).mount("#app1");
            Vue.createApp({ name: 'second-app', ...app }).mount("#app2");
        </script>
    </body>
</html>

What is expected?

The value in the devtools inspector updates after clicking the button.

What is actually happening?

The value does not update in the devtools inspector until the force refresh button is clicked.


repro animation

@konpeki622
Copy link
Contributor

konpeki622 commented Aug 23, 2021

I also reproduced that.

When only one instance was mounted, the root id was defined as 0:root. If the other instance was mounted, like 'second-app', its root id was defined as 1:1, which was expected to be 1:root.

To fix it, I think the logic of component id generation should be optimized.

@Akryum Akryum closed this as completed in 078f29e Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants