Created
June 8, 2021 17:15
-
-
Save thecrypticace/f9964fc7d0e1da295d8ba4e762370889 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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