update head serialize logic

This commit is contained in:
Blake Kostner 2018-03-28 11:53:38 -06:00
parent 5e6ff01f30
commit 2fd1b229cb

View File

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