Open frans-vectra opened 3 years ago
@frans-vectra thanks for sharing. We haven't noticed that kind of behavior. We will check this one this or next week. Cheers.
Hi, I had similar issue like @frans-vectra. My fix for that is below. @lukasborawski Looking forward for your review of that part of storyblok bridge.
setup() {
const { search: searchContent, content: dataFromStoryBlok } = useContent('homepage');
const story = ref({});
onSSR(async () => {
await searchContent({ url: 'homepage', cache: false });
story.value = dataFromStoryBlok.value;
});
onMounted(() => {
story.value = dataFromStoryBlok.value;
// here I tried to customize storyblokBridge code responsible for updating content
if (window) {
// eslint-disable-next-line
const instance = new StoryblokBridge();
instance.on(['input', 'change'], (payload) => {
story.value = {
...payload.story.content,
_meta: payload.story,
};
});
}
});
return {
content: story,
};
}
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!