From 002bb9157eb6a1bbf1ba27f48995891215a40a4a Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Fri, 4 Oct 2019 23:51:32 +0800 Subject: [PATCH] fix: assign markup to ssr context --- packages/saber/vue-renderer/lib/render-html.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/saber/vue-renderer/lib/render-html.js b/packages/saber/vue-renderer/lib/render-html.js index 7d1f20fee..a021bafca 100644 --- a/packages/saber/vue-renderer/lib/render-html.js +++ b/packages/saber/vue-renderer/lib/render-html.js @@ -3,7 +3,7 @@ const getInitialDocument = require('./get-initial-document') module.exports = async (renderer, { url, hooks, isProd }) => { const context = { url } - const markup = await renderer.renderToString(context) + context.markup = await renderer.renderToString(context) // Get document data that is used to document string const documentData = hooks.getDocumentData.call( @@ -25,7 +25,7 @@ module.exports = async (renderer, { url, hooks, isProd }) => { return { html: `${document}`.replace( '
', - markup + context.markup ), context }