diff --git a/docs/fr/guide/advanced/teleport.md b/docs/fr/guide/advanced/teleport.md index 2cc205fc8..bd3cefb81 100644 --- a/docs/fr/guide/advanced/teleport.md +++ b/docs/fr/guide/advanced/teleport.md @@ -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`. diff --git a/docs/guide/advanced/teleport.md b/docs/guide/advanced/teleport.md index f4b10fa84..e6bc3f9dc 100644 --- a/docs/guide/advanced/teleport.md +++ b/docs/guide/advanced/teleport.md @@ -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`.