Merge pull request #3142 from btkostner/head-serialize

update head serialize logic
This commit is contained in:
Sébastien Chopin 2018-03-31 12:46:33 +02:00 committed by GitHub
commit 8de926e25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": _${hash(key)}`
<% if (splitChunks.layouts) { %>let resolvedLayouts = {}<% } %>
export default {
head: <%= serialize(head).replace('head(', 'function(').replace('titleTemplate(', 'function(') %>,
head: <%= serialize(head).replace(/:\w+\(/gm, ':function(') %>,
render(h, props) {
<% if (loading) { %>const loadingEl = h('nuxt-loading', { ref: 'loading' })<% } %>
const layoutEl = h(this.layout || 'nuxt')
@ -121,4 +121,3 @@ export default {
<%= (loading ? 'NuxtLoading' : '') %>
}
}