Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auto-catalog): add component and level option
- Loading branch information
1 parent
437a109
commit 20a1b40
Showing
8 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import { defineClientConfig } from "@vuepress/client"; | ||
import { hasGlobalComponent } from "vuepress-shared/client"; | ||
import Catalog from "vuepress-plugin-components/client/components/Catalog.js"; | ||
|
||
declare const SHOULD_REGISTER_AUTO_CATALOG_COMPONENT: boolean; | ||
|
||
export default defineClientConfig({ | ||
enhance: ({ app }) => { | ||
if (!hasGlobalComponent("AutoCatalog", app)) | ||
app.component("AutoCatalog", Catalog); | ||
if ( | ||
SHOULD_REGISTER_AUTO_CATALOG_COMPONENT && | ||
!hasGlobalComponent("AutoCatalog", app) | ||
) | ||
app.component( | ||
"AutoCatalog", | ||
() => import("vuepress-plugin-components/client/components/Catalog.js") | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters