Skip to content

Commit b72e6e8

Browse files
committed
change head compute time
1 parent c57b842 commit b72e6e8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/plugins/server.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ const SSRServerPlugin = {
2626
if (this.$options.router !== undefined) {
2727
this.$options.router.push(context.url);
2828
}
29-
const head = typeof this.$options.head === 'function' ?
30-
this.$options.head.call(this) :
31-
this.$options.head || {};
32-
this.$options.head = head;
29+
this.$options.$getHead = typeof this.$options.head === 'function' ?
30+
this.$options.head.bind(this) :
31+
() => (this.$options.head || {});
3332
},
3433
});
3534
},

src/renderer/renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Renderer extends EventEmitter implements IRenderer {
144144

145145
if (isPure) return bodyStream;
146146

147-
const head = component.$options.head;
147+
const head = component.$options.$getHead();
148148
const mergedHead = VueHead.headMerge(head, this.options.head);
149149
const template = Renderer.getTemplateHtml(mergedHead, context.state, this.options.global);
150150
const transform = new StreamTransform(template.head, template.tail);

0 commit comments

Comments
 (0)