From 5795a9de219387af116cbebcf543c91a1dfc03cc Mon Sep 17 00:00:00 2001 From: DoomGuy <307901355+abhhjhh28-svg@users.noreply.github.com> Date: Fri, 6 Nov 2026 08:36:22 +0300 Subject: [PATCH] docs: show plugin installation in custom elements --- src/guide/extras/web-components.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/guide/extras/web-components.md b/src/guide/extras/web-components.md index 22aa1cb85b..3bd6872a8b 100644 --- a/src/guide/extras/web-components.md +++ b/src/guide/extras/web-components.md @@ -183,6 +183,20 @@ defineCustomElement(MyComponent, { }) ``` +To use a [Vue plugin](/guide/reusability/plugins) in a custom element, install it on the element's app instance inside `configureApp`: + +```js +import MyPlugin from './my-plugin' + +defineCustomElement(MyComponent, { + configureApp(app) { + app.use(MyPlugin) + } +}) +``` + +Each custom element instance has its own Vue app, so plugins must be installed through `configureApp` for each instance that needs them. + ### SFC as Custom Element {#sfc-as-custom-element} `defineCustomElement` also works with Vue Single-File Components (SFCs). However, with the default tooling setup, the `