Skip to content

fix #1725: Updates attachToDocument documentation tip #1852

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

Merged
merged 1 commit into from
Jun 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions docs/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,12 @@ wrapper.destroy()
`attachToDocument` is deprecated and will be removed in future releases. Use [`attachTo`](#attachto) instead. For example, if you need to attach the component to the document.body:

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

For more information, see [`attachTo`](#attachto)'s tip above.
:::

Like [`attachTo`](#attachto), but automatically creates a new `div` element for you and inserts it into the body.
Expand Down