fix: Handle head as a function in nuxt.config.js

This commit is contained in:
Atinux 2017-11-16 13:32:11 +01:00
parent 4b79c38f41
commit f4577e566c

View File

@ -15,7 +15,7 @@ layoutsKeys.forEach(function (key, i) { %>
let resolvedLayouts = {} let resolvedLayouts = {}
export default { export default {
head: <%= serialize(head).replace('titleTemplate(', 'function(') %>, head: <%= serialize(head).replace('head(', 'function(').replace('titleTemplate(', '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')