mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(kit): allow passing a string to addLayout
(#22902)
This commit is contained in:
parent
ea51421768
commit
aa0ea8bf2d
@ -6,7 +6,7 @@ import { useNuxt } from './context'
|
|||||||
import { logger } from './logger'
|
import { logger } from './logger'
|
||||||
import { addTemplate } from './template'
|
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 nuxt = useNuxt()
|
||||||
const { filename, src } = addTemplate(template)
|
const { filename, src } = addTemplate(template)
|
||||||
const layoutName = kebabCase(name || parse(filename).name).replace(/["']/g, '')
|
const layoutName = kebabCase(name || parse(filename).name).replace(/["']/g, '')
|
||||||
|
Loading…
Reference in New Issue
Block a user