From fd07d1ff38263a73b0e8dd9a874a78dcd0d9f2eb Mon Sep 17 00:00:00 2001 From: Smadey <365649304@qq.com> Date: Wed, 6 Sep 2017 10:38:56 +0800 Subject: [PATCH 1/2] Add "resourcesLoaded" plugin for Renderer Provide the ability to modify resources before use. --- lib/core/renderer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/renderer.js b/lib/core/renderer.js index 08730d5fb4..b11f473248 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -108,6 +108,9 @@ export default class Renderer extends Tapable { this.resources.loadingHTML = '' } + // Call resourcesLoaded plugin + await this.applyPluginsAsync('resourcesLoaded', this.resources) + if (updated.length > 0) { // debug('Updated', updated.join(', '), isServer) this.createRenderer() From e06aaaecc524c0eb2166d4ae5c221c21111e6498 Mon Sep 17 00:00:00 2001 From: Wu Haotian Date: Thu, 7 Sep 2017 10:46:28 +0800 Subject: [PATCH 2/2] rename `context.serverState` to `context.nuxtState` --- lib/app/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/utils.js b/lib/app/utils.js index f95618c886..d98304dd73 100644 --- a/lib/app/utils.js +++ b/lib/app/utils.js @@ -109,7 +109,7 @@ export function getContext (context, app) { ctx.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn) } if (ctx.isClient && window.__NUXT__) { - ctx.serverState = window.__NUXT__ + ctx.nuxtState = window.__NUXT__ } return ctx }