diff --git a/playground/components/TestStage.vue b/playground/components/TestStage.vue new file mode 100644 index 0000000..eb133ae --- /dev/null +++ b/playground/components/TestStage.vue @@ -0,0 +1,7 @@ + diff --git a/playground/pages/test.vue b/playground/pages/test.vue new file mode 100644 index 0000000..e85dc9f --- /dev/null +++ b/playground/pages/test.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/module.ts b/src/module.ts index 8f97289..bff8049 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,4 +1,4 @@ -import { defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit' +import { defineNuxtModule, createResolver, addImportsDir, addComponent } from '@nuxt/kit' import { defu } from 'defu' import type { ModuleOptions } from './runtime/types' @@ -48,5 +48,12 @@ export default defineNuxtModule({ // Step 2: Inject Client side composables to create pdfs from vue components const composables = resolver.resolve('./runtime/composables') addImportsDir(composables) + + // Step 3: Inject PDF Components + addComponent({ + name: 'PDFPage', + export: 'PDFPage', + filePath: resolver.resolve('runtime/components/PDFPage.vue') + }) } }) diff --git a/src/runtime/components/PDFPage.vue b/src/runtime/components/PDFPage.vue new file mode 100644 index 0000000..be8944e --- /dev/null +++ b/src/runtime/components/PDFPage.vue @@ -0,0 +1,6 @@ +