Skip to content

Instantly share code, notes, and snippets.

@brophdawg11
Created March 19, 2018 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brophdawg11/560ce5478ddebbb3a7f1aacc30fbbbc1 to your computer and use it in GitHub Desktop.
Save brophdawg11/560ce5478ddebbb3a7f1aacc30fbbbc1 to your computer and use it in GitHub Desktop.
const Vue = require('vue')
const renderer = require('vue-server-renderer').createRenderer()
// Would expect this to render the v-show="true" div without any style attribute
// Instead, it renders with style="display:;"
const app = new Vue({
template: '<div>\n' +
' <p>v-show=true</p>\n' +
' <p v-show="true">v-show=true</p>\n' +
' <p v-show="false">v-show=false</p>' +
'</div>',
})
renderer.renderToString(app, (err, html) => {
if (err) throw err
console.log(html)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment