Skip to content

bug: Cannot Locate Vue Slot Content to Parent Component #173

Open
@amaoaaaaa

Description

@amaoaaaaa

Where the bug happens

  • Browser Extension
  • Library
  • Other

your browser

Chrome v133.0.6943.99

Describe the bug

LocatorJS is unable to correctly map Vue components when the content is passed via a slot. If a parent component passes elements to a child component using a <slot>, LocatorJS identifies the DOM as part of the child component instead of tracing it back to the parent component where the slot content originates.

Steps to Reproduce

  1. Create a parent component that passes content via a slot:

    <!-- Parent.vue -->
    <template>
      <Child>
        <div class="content">Hello</div>
      </Child>
    </template>
  2. Create a child component that renders the slot:

    <!-- Child.vue -->
    <template>
      <div class="wrapper">
        <slot></slot>
      </div>
    </template>
  3. Use LocatorJS to locate the <div class="content">Hello</div> element.

Expected Behavior

LocatorJS should trace the source of the slot content back to Parent.vue, since that’s where it is defined.

Actual Behavior

LocatorJS instead associates the slot content with Child.vue, making it difficult to locate the original definition in Parent.vue.

Environment

  • Vue Version: 3.4.31
  • LocatorJS Version: 1.3.2
  • Browser: Chrome 133.0.6943.99
  • OS: Windows 11

Would appreciate any insights on how to resolve this issue. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions