Created
January 18, 2017 19:02
-
-
Save g-patel/bb604bef8d440e290d0ff9c0c0dead00 to your computer and use it in GitHub Desktop.
Vuejs Server side rendering with async data
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
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; | |
}); | |
} | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to have
markup
rendered server side?