Skip to content

Instantly share code, notes, and snippets.

@thecrypticace
Created June 8, 2021 17:15
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 thecrypticace/f9964fc7d0e1da295d8ba4e762370889 to your computer and use it in GitHub Desktop.
Save thecrypticace/f9964fc7d0e1da295d8ba4e762370889 to your computer and use it in GitHub Desktop.
async function renderToString(vnodes) {
const el = document.createElement("div")
return new Promise(resolve => {
createApp({
setup() {
onMounted(() => resolve(el.innerHTML)
return () => vnodes
},
}).mount(el)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment