From aa0ea8bf2d71b59344a773bcebd776f89f4cdafd Mon Sep 17 00:00:00 2001 From: Andrey Yolkin Date: Wed, 30 Aug 2023 13:45:16 +0300 Subject: [PATCH] fix(kit): allow passing a string to `addLayout` (#22902) --- packages/kit/src/layout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kit/src/layout.ts b/packages/kit/src/layout.ts index 01d176e968..91e50310c4 100644 --- a/packages/kit/src/layout.ts +++ b/packages/kit/src/layout.ts @@ -6,7 +6,7 @@ import { useNuxt } from './context' import { logger } from './logger' import { addTemplate } from './template' -export function addLayout (this: any, template: NuxtTemplate, name?: string) { +export function addLayout (this: any, template: NuxtTemplate | string, name?: string) { const nuxt = useNuxt() const { filename, src } = addTemplate(template) const layoutName = kebabCase(name || parse(filename).name).replace(/["']/g, '')