From 0cb2df73a026f4a26fb32cbda33377e8debf4a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 18 Dec 2019 15:27:30 +0100 Subject: [PATCH] fix(vue-app): move head to index to avoid global state (#6807) --- packages/vue-app/template/App.js | 5 ----- packages/vue-app/template/index.js | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vue-app/template/App.js b/packages/vue-app/template/App.js index 4300efbcf3..df31d0a58b 100644 --- a/packages/vue-app/template/App.js +++ b/packages/vue-app/template/App.js @@ -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) { %> diff --git a/packages/vue-app/template/index.js b/packages/vue-app/template/index.js index c20a4cab46..327c0dcd4d 100644 --- a/packages/vue-app/template/index.js +++ b/packages/vue-app/template/index.js @@ -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: {