vue-server-renderer-with-data

    2.1.4 • Public • Published

    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" }
    })

    Install

    npm i vue-server-renderer-with-data

    DownloadsWeekly Downloads

    1

    Version

    2.1.4

    License

    ISC

    Last publish

    Collaborators

    • avatar