Skip to content

Suggestion: un-deprecate attachToDocument #1578

Closed
@alexmiddeleer

Description

@alexmiddeleer

I feel the most common use case of attachTo is still attachToDocument, since that is necessary for testing any Vue code that utilizes document.querySelector and similar methods, even if run in total isolation. By un-deprecating attachToDocument, we prevent developers who are new to the library from having to hunt for the following code.

    const elem = document.createElement('div')
    if (document.body) {
      document.body.appendChild(elem)
    }
   wrapper = mount(Component, {
    attachTo: elem
   })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions