Nuxt/packages/nitro/src/runtime/vue2.ts
2020-11-02 01:54:31 +01:00

15 lines
367 B
TypeScript

import { createRenderer } from 'vue-server-renderer/build.prod.js'
const _renderer = createRenderer({})
export function renderToString (component, context) {
return new Promise((resolve, reject) => {
_renderer.renderToString(component, context, (err, result) => {
if (err) {
return reject(err)
}
return resolve(result)
})
})
}