Files in theme/global-components/ directory will not be registered as Vue components automatically. You need to register components manually in clientAppEnhance.{js,ts}.
To know how to register Global Component I've checked the Source Code
Proposed Solution
Add somewhere an example that we could register a global component like
import { defineClientAppEnhance } from "@vuepress/client";
import Test from "./global-components/Test.vue";
export default defineClientAppEnhance(({ app }) => {
app.component("Test", Test);
});
Furthermore, for newbies, it could be interesting to explain what is a global component. Just say that global components are interesting because they could be used into Markdown files and they could be used in any Vue file of the project without be imported.
Feature request
Description
Currently on the doc there is no information to know how to register global component.
We only know at https://vuepress2.netlify.app/guide/migration.html#for-plugin-authors
There is no more information at https://vuepress2.netlify.app/reference/client-api.html#usepagelang
To know how to register Global Component I've checked the Source Code
Proposed Solution
Add somewhere an example that we could register a global component like
Furthermore, for newbies, it could be interesting to explain what is a global component. Just say that global components are interesting because they could be used into Markdown files and they could be used in any Vue file of the project without be imported.
A link to the example could be added into migration guide https://vuepress2.netlify.app/guide/migration.html#for-plugin-authors .