vue-server-renderer-with-data
v2.1.4
Published
server renderer for Vue 2.0 with returning component data
Downloads
4
Readme
vue-server-renderer with component data
Original package: https://www.npmjs.com/package/vue-server-renderer
Update:
method "renderer.renderToString" get third parameter with component data:
const Vue = require('vue')
const renderer = require('vue-server-renderer').createRenderer()
const vm = new Vue({
data:{
foo: 'bar'
},
render (h) {
return h('div', this.foo)
}
})
renderer.renderToString(vm, (err, html, data) => {
console.log(html); // -> <div server-rendered="true">bar</div>
console.log(data); // -> { foo : "bar" }
})