Skip to content

Instantly share code, notes, and snippets.

@g-patel
Created January 18, 2017 19:02
Show Gist options
  • Select an option

  • Save g-patel/bb604bef8d440e290d0ff9c0c0dead00 to your computer and use it in GitHub Desktop.

Select an option

Save g-patel/bb604bef8d440e290d0ff9c0c0dead00 to your computer and use it in GitHub Desktop.
Vuejs Server side rendering with async data
Vue.Component({
name: 'foo',
template: `
<section v-html="markup"></section>
`,
props: [],
data() {
return {
markup: ''
};
},
created () {
this.setMarkup();
},
methods: {
setMarkup() {
//some asnc code like following which will set markup on callback
asyncFunction((err, html) => {
this.markup = html;
});
}
},
});
@g-patel

g-patel commented Jan 18, 2017

Copy link
Copy Markdown
Author

How to have markup rendered server side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment