vue3-yuanma/packages/server-renderer
Evan You 8ad1aab068 test(ssr): refactor ssr render tests
Merge renderToString and renderToStream to run the same tests
2020-12-30 15:40:55 -05:00
..
__tests__ test(ssr): refactor ssr render tests 2020-12-30 15:40:55 -05:00
src fix(ssr): properly handle ssr empty slot and fallback 2020-12-30 15:40:28 -05:00
api-extractor.json refactor(types): mark internal API exports and exclude from d.ts 2020-04-30 17:04:35 -04:00
index.js refactor: rename packages 2018-10-26 15:44:50 -04:00
LICENSE chore: license 2019-10-28 11:15:17 -04:00
package.json release: v3.0.4 2020-12-02 17:23:43 -05:00
README.md chore: readme 2020-02-18 14:56:53 -05:00

@vue/server-renderer

const { createSSRApp } = require('vue')
const { renderToString } = require('@vue/server-renderer')

const app = createSSRApp({
  data: () => ({ msg: 'hello' }),
  template: `<div>{{ msg }}</div>`
})

;(async () => {
  const html = await renderToString(app)
  console.log(html)
})()