Skip to content

Commit 9bdd42e

Browse files
committed
docs: add attachToDocument replacement example (vuejs#1578)
1 parent 73a869b commit 9bdd42e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Diff for: docs/api/options.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,18 @@ wrapper.destroy()
323323
- default: `false`
324324

325325
::: warning Deprecation warning
326-
`attachToDocument` is deprecated and will be removed in future releases. Use [`attachTo`](#attachto) instead.
326+
`attachToDocument` is deprecated and will be removed in future releases. Use [`attachTo`](#attachto) instead. Example:
327+
328+
```js
329+
const elem = document.createElement('div')
330+
if (document.body) {
331+
document.body.appendChild(elem)
332+
}
333+
wrapper = mount(Component, {
334+
attachTo: elem
335+
})
336+
```
337+
327338
:::
328339

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

0 commit comments

Comments
 (0)