Skip to content

Commit 1344c59

Browse files
authored
docs: add teleport stub option
Refs #2335
1 parent ea1cf0f commit 1344c59

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/fr/guide/advanced/teleport.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,20 @@ test('teleport', async () => {
188188
});
189189
```
190190

191+
Vous pouvez remplacer teleport par un stub en utilisant `teleport: true`:
192+
```ts
193+
import { mount } from '@vue/test-utils'
194+
import Navbar from './Navbar.vue'
195+
196+
test('teleport', async () => {
197+
const wrapper = mount(Navbar, {
198+
stubs: {
199+
teleport: true
200+
}
201+
})
202+
})
203+
```
204+
191205
## Conclusion
192206

193207
- Créez une cible de téléportation avec `document.createElement`.

docs/guide/advanced/teleport.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,21 @@ test('teleport', async () => {
187187
})
188188
```
189189

190+
You can stub teleport by using `teleport: true`:
191+
192+
```ts
193+
import { mount } from '@vue/test-utils'
194+
import Navbar from './Navbar.vue'
195+
196+
test('teleport', async () => {
197+
const wrapper = mount(Navbar, {
198+
stubs: {
199+
teleport: true
200+
}
201+
})
202+
})
203+
```
204+
190205
## Conclusion
191206

192207
- Create a teleport target with `document.createElement`.

0 commit comments

Comments
 (0)