Last active
June 14, 2018 19:13
-
-
Save aweber1/807aedfa0472faffb527fdc5b68aa87f to your computer and use it in GitHub Desktop.
vue-meta, JSS, SSR
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
.then((app) => { | |
const renderer = createRenderer(); | |
return renderer.renderToString(app).then((content) => ({ content, app })); // `renderToString` returns a promise | |
}) | |
.then(({ content, app }) => { | |
const meta = app.$meta().inject(); | |
const serverComponent = new Vue({ | |
render(createElement) { | |
return createElement(ServerHtml, { | |
props: { | |
content, | |
initialState: validRouteOrNull, | |
distPath: __BUNDLE_OUTPUT_PATH__, | |
meta, // pass the meta object as prop to `ServerHtml` | |
}, | |
}); | |
}, | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment