You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
Hi, I'm struggling to get the realtime preview to work. It seems like components aren't rerendered when the input Storyblok event is fired.
I followed the Real-time Visual Editor documentation and this is what my root page component looks like:
<template><render-contentv-if="content" :content="content"/></template><script>import{useContent,storyblokBridge}from'@vue-storefront/storyblok'import{onSSR}from'@vue-storefront/core'import{computed,onMounted}from'@vue/composition-api'import{useVueRouter}from'~/helpers/hooks/useVueRouter'exportdefault{name: 'Page',setup(){const{ route }=useVueRouter()constslug=route.params.slugconst{ search, content }=useContent(slug)// wrap your content with reactive computed functionconststory=computed(()=>content.value)// get dataonSSR(async()=>{awaitsearch({cache: false,version: 'draft',url: slug,})})// init the Storyblok BridgeonMounted(()=>{storyblokBridge(story.value)})return{content: story,}},}</script>
One thing I see that doesn't make sense (looking at the storyblokBridge code) is that its expecting a content object with the following structure:
{
content: {
...
}}
i.e. wrapped in a containing object, but the story object thats passed to isn't wrapped in this object container (going by the example in the documentation).
I've tried adding this missing wrapping object but it still doesn't seem to work. It also seems like the reactivity of the content object is lost when the new value is assigned to it.
Any guidance would be appreciated!
The text was updated successfully, but these errors were encountered:
Hi, I'm struggling to get the realtime preview to work. It seems like components aren't rerendered when the
input
Storyblok event is fired.I followed the Real-time Visual Editor documentation and this is what my root page component looks like:
One thing I see that doesn't make sense (looking at the
storyblokBridge
code) is that its expecting acontent
object with the following structure:i.e. wrapped in a containing object, but the
story
object thats passed to isn't wrapped in this object container (going by the example in the documentation).I've tried adding this missing wrapping object but it still doesn't seem to work. It also seems like the reactivity of the content object is lost when the new value is assigned to it.
Any guidance would be appreciated!
The text was updated successfully, but these errors were encountered: