mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
fix: set default name to layout to avoid multi mounted (#7128)
This commit is contained in:
parent
90c6922f42
commit
b82f8d1640
@ -4,7 +4,8 @@ import {
|
||||
getMatchedComponentsInstances,
|
||||
getChildrenComponentInstancesUsingFetch,
|
||||
promisify,
|
||||
globalHandleError
|
||||
globalHandleError,
|
||||
sanitizeComponent
|
||||
} from './utils'
|
||||
<% } %>
|
||||
<% if (features.layouts && components.ErrorPage) { %>import NuxtError from '<%= components.ErrorPage %>'<% } %>
|
||||
@ -23,7 +24,7 @@ import '<%= relativeToBuild(resolvePath(c.src || c, { isStyle: true })) %>'
|
||||
}
|
||||
}).join('\n') %>
|
||||
|
||||
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": _${hash(key)}`).join(',') %> }<%= isTest ? '// eslint-disable-line' : '' %>
|
||||
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": sanitizeComponent(_${hash(key)})`).join(',') %> }<%= isTest ? '// eslint-disable-line' : '' %>
|
||||
|
||||
<% if (splitChunks.layouts) { %>let resolvedLayouts = {}<% } %>
|
||||
<% } %>
|
||||
|
@ -80,7 +80,7 @@ export function sanitizeComponent (Component) {
|
||||
Component._Ctor = Component
|
||||
Component.extendOptions = Component.options
|
||||
}
|
||||
// For debugging purpose
|
||||
// If no component name defined, set file path as name, (also fixes #5703)
|
||||
if (!Component.options.name && Component.options.__file) {
|
||||
Component.options.name = Component.options.__file
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user