Skip to content

Commit b8da036

Browse files
authored
Adds Context to attachTo Option Example (#1602)
Previously, the documentation for attachTo provided an example where a component was being attached to a div with an id of `root`, but without it being defined it's kind of distracting. This update explicitly defines the element and attaches it to the document for clarity.
1 parent 6894540 commit b8da036

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/api/options.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ When attaching to the DOM, you should call `wrapper.destroy()` at the end of you
301301
remove the rendered elements from the document and destroy the component instance.
302302

303303
```js
304+
const div = document.createElement('div')
305+
div.id = 'root'
306+
document.body.appendChild(div)
307+
304308
const Component = {
305309
template: '<div>ABC</div>'
306310
}

0 commit comments

Comments
 (0)