daily pastebin goal
86%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // the following code would be in the `.then((content)` chain after `renderer.renderToString(app)`
  2. // where `app` is a Vue instance, and assumes you've already registered the Meta plugin elsewhere via Vue.use(Meta);
  3. const meta = app.$meta().inject();
  4. const serverComponent = new Vue({
  5.   render(createElement) {
  6.     return createElement(ServerHtml, {
  7.       props: {
  8.         content,
  9.         initialState: validRouteOrNull,
  10.         distPath: __BUNDLE_OUTPUT_PATH__,
  11.         meta, // pass the meta object as prop to `ServerHtml`
  12.       },
  13.     });
  14.   },
  15. });
  16.    
  17. ...
  18. <head>
  19.   <title>{this.meta.title.text()}</title>
  20. </head>
  21. ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top