summaryrefslogtreecommitdiff
path: root/packages/integrations/vue/README.md
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-10-13 14:15:57 -0500
committerGravatar GitHub <noreply@github.com> 2022-10-13 14:15:57 -0500
commitd25f54cb9306eea9ed0445af8f77604dacacad43 (patch)
treeb5b1c93b4c9a2685b052e3c39f91f916bf6b086f /packages/integrations/vue/README.md
parent6f9a88b31ba0881acd56fcb62c4a554c867b14d6 (diff)
downloadastro-d25f54cb9306eea9ed0445af8f77604dacacad43.tar.gz
astro-d25f54cb9306eea9ed0445af8f77604dacacad43.tar.zst
astro-d25f54cb9306eea9ed0445af8f77604dacacad43.zip
[Vue] add support for `appEntrypoint` (#5075)
* feat(vue): add support for appEntrypoint * chore: add changeset * test(vue): add tests for app entrypoint * docs(vue): update README to include app entrypoint * fix(vue): prefer resolvedVirtualModuleId Co-authored-by: Nate Moore <nate@astro.build>
Diffstat (limited to 'packages/integrations/vue/README.md')
-rw-r--r--packages/integrations/vue/README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/integrations/vue/README.md b/packages/integrations/vue/README.md
index 75c861ce3..c1c199b81 100644
--- a/packages/integrations/vue/README.md
+++ b/packages/integrations/vue/README.md
@@ -95,6 +95,36 @@ export default {
}
```
+### appEntrypoint
+
+You can extend the Vue `app` instance setting the `appEntrypoint` option to a root-relative import specifier (for example, `appEntrypoint: "/src/pages/_app"`).
+
+The default export of this file should be a function that accepts a Vue `App` instance prior to rendering, allowing the use of [custom Vue plugins](https://vuejs.org/guide/reusability/plugins.html), `app.use`, and other customizations for advanced use cases.
+
+__`astro.config.mjs`__
+
+```js
+import { defineConfig } from 'astro/config';
+import vue from '@astrojs/vue';
+
+export default defineConfig({
+ integrations: [
+ vue({ appEntrypoint: '/src/pages/_app' })
+ ],
+});
+```
+
+__`src/pages/_app.ts`__
+
+```js
+import type { App } from 'vue';
+import i18nPlugin from 'my-vue-i18n-plugin';
+
+export default (app: App) => {
+ app.use(i18nPlugin);
+}
+```
+
### jsx
You can use Vue JSX by setting `jsx: true`.