From 117b3aa524978cb5f96fa236fdea1923792db3c8 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 18 Oct 2021 12:59:31 +0100 Subject: [PATCH] fix(nuxt3): destructure components options (#1165) --- packages/nuxt3/src/components/templates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt3/src/components/templates.ts b/packages/nuxt3/src/components/templates.ts index eb4f170191..6ae0e35dd5 100644 --- a/packages/nuxt3/src/components/templates.ts +++ b/packages/nuxt3/src/components/templates.ts @@ -25,7 +25,7 @@ const createImportMagicComments = (options: ImportMagicCommentsOptions) => { export const componentsTemplate = { filename: 'components.mjs', - getContents (options: ComponentsTemplateOptions) { + getContents ({ options }: { options: ComponentsTemplateOptions }) { return `import { defineAsyncComponent } from 'vue' const components = { @@ -50,7 +50,7 @@ export default function (nuxt) { export const componentsTypeTemplate = { filename: 'components.d.ts', write: true, - getContents: (options: ComponentsTemplateOptions) => `// Generated by components discovery + getContents: ({ options }: { options: ComponentsTemplateOptions }) => `// Generated by components discovery declare module 'vue' { export interface GlobalComponents { ${options.components.map(c => ` '${c.pascalName}': typeof import('${relative(options.buildDir, c.filePath)}')['${c.export}']`).join(',\n')}