Skip to content

Commit

Permalink
Fixed vitepress build window undefeind error
Browse files Browse the repository at this point in the history
  • Loading branch information
ihavecoke committed Nov 1, 2023
1 parent bc40a5d commit 53a9d66
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import DefaultTheme from 'vitepress/theme';
import '../../style.scss';
import VPBadge from 'vitepress/dist/client/theme-default/components/VPBadge.vue';
import DefaultTheme from "vitepress/theme";
import "../../style.scss";
import VPBadge from "vitepress/dist/client/theme-default/components/VPBadge.vue";
const theme = {
...DefaultTheme,
enhanceApp: (ctx) => {
const { app } = ctx;
app.component('Badge', VPBadge);
window.WhaleDocs = ctx;
app.component("Badge", VPBadge);
if (typeof window !== "undefined") {
window.WhaleDocs = ctx;
}
}
},
};
export default theme;

0 comments on commit 53a9d66

Please sign in to comment.