Skip to content

Commit

Permalink
docs(api): add note for attachTo (#2267)
Browse files Browse the repository at this point in the history
Add an explanation about the mounting mechanism. This information is available in v1 docs, but not in v2 docs.
  • Loading branch information
ArtemTropanets committed Dec 4, 2023
1 parent b6e5b82 commit e16ae5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api/index.md
Expand Up @@ -81,6 +81,8 @@ attachTo?: HTMLElement | string

Can be a valid CSS selector, or an [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element) connected to the document.

Note that the component is appended to the node, it doesn't replace the whole content of the node. If you mount the component on the same node in multiple tests - make sure to unmount it after each test by calling `wrapper.unmount()`, this will remove the rendered elements from the node.

`Component.vue`:

```vue
Expand Down

0 comments on commit e16ae5a

Please sign in to comment.