Skip to content

Commit

Permalink
docs: add teleport stub option
Browse files Browse the repository at this point in the history
Refs #2335
  • Loading branch information
blizzardKv committed Feb 12, 2024
1 parent ea1cf0f commit 1344c59
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/fr/guide/advanced/teleport.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@ test('teleport', async () => {
});
```

Vous pouvez remplacer teleport par un stub en utilisant `teleport: true`:
```ts
import { mount } from '@vue/test-utils'
import Navbar from './Navbar.vue'

test('teleport', async () => {
const wrapper = mount(Navbar, {
stubs: {
teleport: true
}
})
})
```

## Conclusion

- Créez une cible de téléportation avec `document.createElement`.
Expand Down
15 changes: 15 additions & 0 deletions docs/guide/advanced/teleport.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ test('teleport', async () => {
})
```

You can stub teleport by using `teleport: true`:

```ts
import { mount } from '@vue/test-utils'
import Navbar from './Navbar.vue'

test('teleport', async () => {
const wrapper = mount(Navbar, {
stubs: {
teleport: true
}
})
})
```

## Conclusion

- Create a teleport target with `document.createElement`.
Expand Down

0 comments on commit 1344c59

Please sign in to comment.