Initial commit: vitepress-exporter plugin

This commit is contained in:
2026-04-20 12:00:50 +08:00
commit e54a8a3b05
15 changed files with 6761 additions and 0 deletions

19
docs/.vuepress/config.ts Normal file
View File

@@ -0,0 +1,19 @@
import { defaultTheme } from '@vuepress/theme-default';
import type { DefaultThemeOptions } from '@vuepress/theme-default';
import type { PluginOptions } from 'vuepress';
export default {
title: 'VitePress Demo',
description: 'Demo for VitePress with Canvas Viewer',
theme: defaultTheme<DefaultThemeOptions>({
navbar: [
{
text: 'Home',
link: '/',
},
],
}),
clientConfigFile: 'index.ts',
} satisfies PluginOptions;

8
docs/index.ts Normal file
View File

@@ -0,0 +1,8 @@
import { defineClientConfig } from '@vuepress/client';
import { CanvasViewerPlugin } from './plugins/canvas-viewer';
export default defineClientConfig({
enhance({ app, router }) {
app.use(CanvasViewerPlugin);
}
});

View File

@@ -0,0 +1,7 @@
import type { Plugin } from 'vue';
export const CanvasViewerPlugin: Plugin = {
install(app) {
app.component('CanvasViewer', () => import('./components/CanvasViewer.vue'));
}
};