Skip to content
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

Components are not selectable with Vue devtools when mounted in a shadowDom #1849

Open
p-gerard opened this issue Apr 28, 2022 · 2 comments
Open

Comments

@p-gerard
Copy link

Version

6.1.4

Browser and OS info

Chrome 100.0.4896.127 / macOS monterey 12.3.1

Steps to reproduce

Serve the HTML file below.

Components in the first Vue app are selectable with the Vue devtools.

Components in the second Vue app, mounted in a shadowDom, are not.

<!DOCTYPE html>
<html>
<head>
  <title>Vue devtools shadowDom test</title>
  <script src="https://unpkg.com/vue@2.6.11"></script>
  <script>
    class MyWebComponent extends HTMLElement {
      constructor() {
        super();
      }
    }
    customElements.define('my-web-component', MyWebComponent);
  </script>
</head>
<body>

  <div id="std-app"></div>

  <my-web-component></my-web-component>

  <script>
    Vue.component('my-vue-component', {
      template: '<h1>{{ message }}</h1>',
      props: ['message']
    });

    const standardApp = new Vue({
      name: 'StandardApp',
      el: '#std-app',
      template: `
      <div>
        <my-vue-component message="standard app - select component works" />
      </div>`,
    })

    const myWebComponent = document.querySelector('my-web-component');
    const shadow = myWebComponent.attachShadow({ mode: 'open' });
    const shadowDiv = document.createElement('div');
    shadow.appendChild(shadowDiv);

    new Vue({
      name: 'ShadowApp',
      template: `
      <div>
        <my-vue-component message="shadow app - select component doesn't work" />
      </div>`,
    }).$mount(shadowDiv);
  </script>
</body>
</html>

What is expected?

Components in the second Vue app, mounted in a shadowDom should be selectable with the Vue devtools.

What is actually happening?

Components in the second Vue app, mounted in a shadowDom are not selectable with the Vue devtools.

@NielsJorck
Copy link

Issue is in the core project: vuejs/core#4356
Also same issue already in the devtool project here: #1673

@larryval
Copy link

p-gerard have you succed for this problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants