fix(vue-app): move head to index to avoid global state (#6807)

This commit is contained in:
Sébastien Chopin 2019-12-18 15:27:30 +01:00 committed by Pooya Parsa
parent 7af9ec8c23
commit 0cb2df73a0
2 changed files with 5 additions and 5 deletions

View File

@ -28,11 +28,6 @@ const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": _${hash(key)}`
<% } %>
export default {
<% if (features.meta) { %>
<%= isTest ? '/* eslint-disable array-bracket-spacing, quotes, quote-props, semi, indent, comma-spacing, key-spacing, object-curly-spacing, space-before-function-paren, object-shorthand */' : '' %>
head: <%= serializeFunction(head) %>,
<%= isTest ? '/* eslint-enable array-bracket-spacing, quotes, quote-props, semi, indent, comma-spacing, key-spacing, object-curly-spacing, space-before-function-paren, object-shorthand */' : '' %>
<% } %>
render (h, props) {
<% if (loading) { %>const loadingEl = h('NuxtLoading', { ref: 'loading' })<% } %>
<% if (features.layouts) { %>

View File

@ -85,6 +85,11 @@ async function createApp (ssrContext) {
// here we inject the router and store to all child components,
// making them available everywhere as `this.$router` and `this.$store`.
const app = {
<% if (features.meta) { %>
<%= isTest ? '/* eslint-disable array-bracket-spacing, quotes, quote-props, semi, indent, comma-spacing, key-spacing, object-curly-spacing, space-before-function-paren, object-shorthand */' : '' %>
head: <%= serializeFunction(head) %>,
<%= isTest ? '/* eslint-enable array-bracket-spacing, quotes, quote-props, semi, indent, comma-spacing, key-spacing, object-curly-spacing, space-before-function-paren, object-shorthand */' : '' %>
<% } %>
<% if (store) { %>store,<% } %>
router,
nuxt: {