@ -11,6 +11,7 @@ interface Renderer {
renderToString(vm: Vue, callback: RenderCallback): void;
renderToString(vm: Vue, context: object, callback: RenderCallback): void;
renderToString(vm: Vue): Promise<string>;
renderToString(vm: Vue, context: object): Promise<string>;
renderToStream(vm: Vue, context?: object): Readable;
}
@ -46,6 +46,14 @@ renderer.renderToString(app)
throw err;
});
renderer.renderToString(app, context)
.then(html => {
const res: string = html;
})
.catch(err => {
renderer.renderToStream(app, context).on('data', chunk => {
const html = chunk.toString();