Created
August 6, 2021 12:46
-
-
Save andikasputra/8e1e5c7c1cc800516cf84ee16240be29 to your computer and use it in GitHub Desktop.
php server side rendering
This file contains 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
import renderVueComponentToString from "vue-server-renderer/basic"; | |
import app from "./app"; | |
app.$store.commit("setUser", { user: context.user }); | |
app.$store.state.features = context.features; | |
renderVueComponentToString(app, (err, html) => { | |
if (err) { | |
throw new Error(err); | |
} | |
console.log(html); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment