@@ -18,6 +18,9 @@ import "./scrollbar.css";
1818import "./tailwind.postcss" ;
1919import "vitepress-openapi/dist/style.css" ;
2020
21+ // Import plugins
22+ import { enhanceAppWithTabs } from "vitepress-plugin-tabs/client" ;
23+
2124// @ts -ignore
2225import spec from "../../public/openapi.json" assert { type : "json" } ;
2326
@@ -40,13 +43,15 @@ export default {
4043 extends : DefaultTheme ,
4144 Layout : Landing ,
4245 enhanceApp ( { app, router, siteData } ) {
46+ enhanceAppWithTabs ( app ) ;
47+
4348 const openapi = useOpenapi ( {
4449 spec,
4550 base : "/docs/api-reference/api/operations/" ,
4651 label : "API" ,
4752 } ) ;
4853
49- theme . enhanceApp ( { app, openapi } )
54+ theme . enhanceApp ( { app, openapi } ) ;
5055 app . component ( "Card" , Card ) ;
5156 app . component ( "CardGroup" , CardGroup ) ;
5257 app . component ( "LandingSection" , Sections ) ;
@@ -60,21 +65,25 @@ export default {
6065 app . component ( "Browser" , Browser ) ;
6166
6267 router . onAfterRouteChange = ( ) => {
63- if ( typeof window !== ' undefined' && ( window as any ) . plausible ) {
64- ( window as any ) . plausible ( ' pageview' )
68+ if ( typeof window !== " undefined" && ( window as any ) . plausible ) {
69+ ( window as any ) . plausible ( " pageview" ) ;
6570 }
66- }
67- app . directive ( ' plausible' , {
71+ } ;
72+ app . directive ( " plausible" , {
6873 mounted ( el : HTMLElement , binding : DirectiveBinding ) {
69- const eventName = binding . arg
70- const eventData = binding . value || { }
74+ const eventName = binding . arg ;
75+ const eventData = binding . value || { } ;
7176
72- el . addEventListener ( 'click' , ( ) => {
73- if ( typeof window !== 'undefined' && ( window as any ) . plausible && eventName ) {
74- ( window as any ) . plausible ( eventName , { props : eventData } )
77+ el . addEventListener ( "click" , ( ) => {
78+ if (
79+ typeof window !== "undefined" &&
80+ ( window as any ) . plausible &&
81+ eventName
82+ ) {
83+ ( window as any ) . plausible ( eventName , { props : eventData } ) ;
7584 }
76- } )
77- }
78- } )
85+ } ) ;
86+ } ,
87+ } ) ;
7988 } ,
8089} satisfies Theme ;
0 commit comments