-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
To make SSR finally work with cmsBlock:
- just rename
asyncDatatoserverPrefetch. - remove function params (as not needed) and outdated comments
- change
store.dispatchtothis.$store.dispatch
And BAM, just some new vue magic and it works as intended
serverPrefetch is out there since vue version 2.6 and gives you access to this object
https://ssr.vuejs.org/api/#serverprefetch
serverPrefetch () {
return new Promise((resolve, reject) => {
this.$store.dispatch('cmsBlock/single', {
value: this.identifier
}).then(res => {
return resolve(res)
})
})
}